[wp-trac] [WordPress Trac] #40109: Ensure PHP 7.2 compatibility in tests (and core)

WordPress Trac noreply at wordpress.org
Sat Mar 11 12:49:44 UTC 2017


#40109: Ensure PHP 7.2 compatibility in tests (and core)
------------------------------+----------------------------
 Reporter:  ocean90           |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  low               |  Milestone:  Future Release
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  has-patch
  Focuses:                    |
------------------------------+----------------------------
 The [https://travis-ci.org/aaronjorbin/develop.wordpress/jobs/209970096
 lastest Travis build for 7.2-dev] has a few errors. I haven't found a
 roadmap but I think PHP 7.2 is planned for end of this year. So, while PHP
 7.2 is still at the beginning we should start looking at the results and
 review each error. We did the same for PHP 7.1 and identified a bug in PHP
 itself, see #37295.

 ----

 [https://wiki.php.net/rfc/deprecations_php_7_2 PHP 7.2 is going to
 deprecate]
 * `create_function()`
 * `__autoload()`
 * `each()`
 * calling `assert()` with a string argument

 Also, [https://wiki.php.net/rfc/counting_non_countables counting of non-
 countable objects] will start throwing a warning in PHP 7.2.

 ----

 * `create_function()` is handled in #37082.
 * The `assert()` calls in `WP_Import_UnitTestCase::_import_wp()` should be
 replaced with `assertTrue()` and a custom message.
 * `testXMLParser::parse()`: `sizeof()`  returns always `1` for a string,
 even if the string is empty. Same for `false`. Seems like we can just pass
 `true` as the third argument for `xml_parse()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40109>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list