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

WordPress Trac noreply at wordpress.org
Wed Apr 8 14:40:14 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 pikamander2):

 @Otto42 - Yeah, that's not too surprising. My biggest fear with pushing
 these changes is that they might break production code.

 On the flip side though, that's exactly why these kinds of changes are
 needed. Loose comparisons allow for a lot of poorly-defined behavior
 that's not obvious at a glance. The more comparisons we convert to strict,
 the easier it becomes to see what the function is expecting and can
 handle.

 Pinging @SergeyBiryukov for thoughts.

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


More information about the wp-trac mailing list