Page MenuHomePhabricator

PHP function each() has been deprecated
Closed, ResolvedPublic

Description

The PHP-function each() has been deprecated as of PHP 7.2.0 (https://wiki.php.net/rfc/deprecations_php_7_2#each). It has been fixed in T174354
for the MediaWiki-Core, but the vendor-directory still contains each()-function-calls:

pear/mail_mime
vendor/pear/mail_mime/Mail/mimePart.php:

while (list($idx, $line) = each($lines)) {

vendor/pear/mail_mime/Mail/mime.php:

while (list($key, $value) = each($params)) {

vendor/pear/mail_mime/Mail/mime.php:

while (list($key, $value) = each($params)) {

pear/pear-core-minimal
vendor/pear/pear-core-minimal/src/PEAR.php:

while (list($k, $objref) = each($_PEAR_destructor_object_list)) {

pear/console_getopt
vendor/pear/console_getopt/Console/Getopt.php:

while (list($i, $arg) = each($args)) {

vendor/pear/console_getopt/Console/Getopt.php:

} else if (list(, $opt_arg) = each($args)) {

vendor/pear/console_getopt/Console/Getopt.php:

if (!strlen($opt_arg) && !(list(, $opt_arg) = each($args))) {

pear/mail_mime-decode
vendor/pear/mail_mime-decode/Mail/mimePart.php:

while(list(, $line) = each($lines)){

vendor/pear/mail_mime-decode/Mail/mimeDecode.php:

while (list($key, $value) = each($headers)) {

vendor/pear/mail_mime-decode/Mail/mimeDecode.php:

while (list($p_name, $p_value) = each($content_type['other'])) {

vendor/pear/mail_mime-decode/Mail/mimeDecode.php:

while (list($p_name, $p_value) = each($content_disposition['other'])) {

vendor/pear/mail_mime-decode/Mail/mime.php:

while (list($key, $value) = each($build_params)) {

ruflin/elastica
vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:

while (list($header, $headerValue) = each($headersConfig)) {

vendor/ruflin/elastica/lib/Elastica/Multi/MultiBuilder.php:

list($key, $search) = each($searches);

phpunit/phpunit
vendor/phpunit/phpunit/src/Util/Getopt.php on line 38:

while (list($i, $arg) = each($args)) {

Event Timeline

Efellows created this task.Dec 6 2017, 9:23 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 6 2017, 9:23 AM
Legoktm added a subscriber: Legoktm.

We'll need to submit upstream bug reports for all of these...

We'll need to submit upstream bug reports for all of these...

I can only guess that would be https://github.com/ruflin/Elastica and https://pear.php.net/bugs/ ?
Wondering if they should be listed on https://www.mediawiki.org/wiki/Upstream_projects or if that's off.

I can confirm that https://pear.php.net/bugs/ is the correct place for PEAR-bug-reports. For reporting bugs there you need either a confirmed account or need to confirm the confirmation-email after reporting the bug.
However, I still haven't received my confirmation-email for an other bug-report there this week.

demon triaged this task as Lowest priority.Jan 12 2018, 10:52 PM
RazeSoldier added a subscriber: RazeSoldier.

This is not a core issue.

RazeSoldier updated the task description. (Show Details)Mar 29 2018, 9:46 AM
RazeSoldier updated the task description. (Show Details)Mar 29 2018, 9:56 AM
RazeSoldier added a comment.EditedMar 29 2018, 10:02 AM

If we make PHPUnit 4 upgrade to PHPUnit 6, may be able to solve PHPUnit deprecation information.

TK-999 added a subscriber: TK-999.Apr 26 2018, 2:27 PM

FYI, PHP 7.2 compatibility issues are fixed in version 1.10.2 of the PEAR Mail_Mime library.

Aklapper renamed this task from PHP-function each() has been deprecated to PHP function each() has been deprecated.Apr 28 2018, 4:22 PM
RazeSoldier closed this task as Resolved.Jun 11 2018, 2:56 PM
RazeSoldier claimed this task.

On master and REL1_31, already requires pear/mail_mime 1.10.2.

RazeSoldier removed RazeSoldier as the assignee of this task.Jun 11 2018, 2:57 PM