[wp-trac] [WordPress Trac] #43583: Introduce new PHP cross-version compat function `is_countable()`

WordPress Trac noreply at wordpress.org
Thu May 10 19:24:44 UTC 2018


#43583: Introduce new PHP cross-version compat function `is_countable()`
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  4.9.6
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:
  note commit                                    |
-------------------------------------------------+-------------------------

Comment (by ayeshrajans):

 Thumbs up for skipping the test in pre-5.4 PHP versions and calling it a
 day. The polyfill simply returns true if the object is of class
 `ResourceBundle` and doesn't inspect anything deeper. Until PHP provides
 means to inspect the internal class implementations for `count_elements`
 hook, `is_countable` polyfills won't be perfect anyway.

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


More information about the wp-trac mailing list