[wp-trac] [WordPress Trac] #44123: Utilize `is_countable()` and `is_iterable()` Polyfills

WordPress Trac noreply at wordpress.org
Sun May 20 21:32:15 UTC 2018


#44123: Utilize `is_countable()` and `is_iterable()` Polyfills
----------------------------+---------------------
 Reporter:  desrosj         |       Owner:  (none)
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  4.9.7
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:
----------------------------+---------------------

Comment (by jrf):

 @thrijith Thank you for your contributions to this! I'll try to review the
 patches later this week.

 As a general - but important - side-note (without having reviewed the
 patches): `is_countable()` should only be added when needed, not blindly
 to every `count()`.
 If an array is expected somewhere and the variable being tested is not a
 parameter being passed in or the output of a `apply_filters()` call either
 in the function in question or in a function from which the output is
 being used, `is_countable()` should not be added as it should not be
 needed and adding it may hide bugs which should be solved instead.

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


More information about the wp-trac mailing list