[wp-trac] [WordPress Trac] #41987: Should use strict comparison at line 71 in wp-admin/admin.php

WordPress Trac noreply at wordpress.org
Tue Sep 26 04:39:34 UTC 2017


#41987: Should use strict comparison at line 71 in wp-admin/admin.php
-------------------------------------+------------------------------
 Reporter:  rnaby                    |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  close reporter-feedback  |     Focuses:
-------------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => close reporter-feedback


Comment:

 I don't I see any benefit in strict type checking in scenario's like this
 or #41988

 As `mt_rand()` only returns `int` or `false` and we don't really need to
 care about any non-int return values, especially in this section of code.

 A scenario where it would be useful is cases where "falsey" values are
 expected, such as #21249

 What benefit does the proposed changes actually give?
 FWIW our PHP Coding Standards are available here:
 https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/php/

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


More information about the wp-trac mailing list