[wp-trac] [WordPress Trac] #48965: Prefer strict PHP comparisons over loose PHP comparisons

WordPress Trac noreply at wordpress.org
Wed Apr 8 18:21:43 UTC 2020


#48965: Prefer strict PHP comparisons over loose PHP comparisons
-------------------------+-------------------------------
 Reporter:  pikamander2  |       Owner:  SergeyBiryukov
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  5.4
Component:  General      |     Version:
 Severity:  minor        |  Resolution:  fixed
 Keywords:               |     Focuses:  coding-standards
-------------------------+-------------------------------

Comment (by MattyRob):

 Actually, thinking again using `empty()` would not allow for a post title
 of '0' (as in zero).

 Perhaps we need a better check or revert the strict check

 `if ( '' === (string) $post_title ) {`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48965#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list