Topic on Project:Support desk

Deprecated code in /includes/MagicWord.php

6
רועי (talkcontribs)

MediaWiki V1.30.0

PHP version 7.2.2 (apache2handler)

MySQL 5.7.21

There seems to be deprecated code in /includes/MagicWord.php line 206:

while ( list( $key, $value ) = each( $m ) ) { ...

Maybe replace with:

foreach ($m as $key=>$value) {

2001:16B8:10F2:3400:8CCF:3FDD:68E3:7673 (talkcontribs)
2001:16B8:10F2:3400:A150:F8BA:2A8F:73AD (talkcontribs)

I cannot find this issue in master and also not in the 1.30 branch.

Also version 1.29 does '''not''' have an each() in that file. Are you sure you have updated your installation properly? Are you maybe still using an old version of that file?

רועי (talkcontribs)
2001:16B8:10F2:3400:F47B:A496:EC8F:C566 (talkcontribs)

MediaWiki 1.30 is not fully compatible with PHP 7.2. Note however that we a re not speaking about a broken functionality, but only about a deprecation warning.

MediaWiki 1.31, which will be created from latest master, will be compatible with PHP 7.2 in that regard.

2001:16B8:10ED:5800:4417:8535:D972:3EF8 (talkcontribs)

Here is a patch for this issue - which only is part of MediaWiki 1.31: https://phabricator.wikimedia.org/T174354

MediaWiki 1.30 officially is not compatible with PHP 7.2, but you can apply the patch manually to get MW 1.30 working with PHP 7.2 as well.

Reply to "Deprecated code in /includes/MagicWord.php"