[wp-trac] [WordPress Trac] #44416: `compact()` will throw notice for undefined variables in PHP 7.3
WordPress Trac
noreply at wordpress.org
Wed Jun 20 20:17:38 UTC 2018
#44416: `compact()` will throw notice for undefined variables in PHP 7.3
--------------------------+----------------------------
Reporter: desrosj | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version:
Severity: normal | Keywords: needs-patch
Focuses: |
--------------------------+----------------------------
PHP 7.3 has been released [http://php.net/archive/2018.php#id2018-06-07-1
Alpha 1]. While this is still an early development version, one of the
[https://wiki.php.net/rfc/compact accepted] and [https://github.com/php
/php-src/pull/3240 committed] changes is exposing some undefined
variables.
In PHP 7.3, the `compact()` function has been changed to issue an
`E_NOTICE` level error if a passed string refers to an unset variable. In
previous versions of PHP, this notice was silently skipped. The full RFC
can be viewed here: https://wiki.php.net/rfc/compact
While it may be early to fix PHP 7.3 compatibility issues, this one
exposes variables that are potentially being handled incorrectly and
should be investigated.
The main offenders appear to be:
- `wp_insert_post()`
- `wp_xmlrpc_server->mw_newPost();`
- `WP_Comment_Query->get_comment_ids()`
To see the warnings thrown, [https://travis-ci.org/WordPress/wordpress-
develop/jobs/394396151 look at the nightly PHP job on any recent build for
`master`]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44416>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list