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

WordPress Trac noreply at wordpress.org
Thu May 10 18:38:09 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 jrf):

 The Travis build is failing for PHP 5.3: https://travis-ci.org/WordPress
 /wordpress-develop/jobs/377390901#L670-L675

 `ResourceBundle` was added in PHP 5.3.2, but I know the PHP 5.4 release(s)
 contained a lot of improvements to the implementation and integration of
 the Intl extension.
 To verify what's going on here, someone would need to digging into PHP
 core source deeply to check the implementation details of `ResourceBundle`
 between 5.3 vs 5.4.

 To be fair, as PHP 5.3 is ancient, I think that would be over the top and
 wasting people's time.

 I suggest adding a PHPUnit `@requires PHP 5.4` annotation to the docblock
 of the `test_is_countable_ResourceBundle()` unit test to just skip the
 test on PHP 5.3.

 The fact that for `ResourceBundle` the Polyfill does not work the same as
 the PHP 7.2 function on PHP 5.3 is something I'm not to concerned about as
 it's such an edge case.

 Opinions ?

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


More information about the wp-trac mailing list