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

WordPress Trac noreply at wordpress.org
Sun May 20 21:43:17 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 thrijith):

 Replying to [comment:9 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.

 Noted. Thanks for the input, I have added comments on tickets where I had
 my doubts, Please let me know if changes are needed from my end.

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


More information about the wp-trac mailing list