Page MenuHomePhabricator

Possible MW Core PHP 7 issues
Closed, DuplicatePublic

Description

From https://github.com/sstalle/php7cc

File: /home/reedy/mediawiki/img_auth.php
> Line 192: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/tests/phpunit/MediaWikiTestCase.php
> Line 1562: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/tests/phpunit/maintenance/MaintenanceTest.php
> Line 82: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/tests/phpunit/includes/api/query/ApiQueryTestBase.php
> Line 43: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/logging/LogPage.php
> Line 259: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/debug/logger/monolog/AvroFormatter.php
> Line 167: [Error] Bitwise shift by 32 bits
    ($id & 1.8446744069414584E+19) >> 32;


File: /home/reedy/mediawiki/includes/Block.php
> Line 137: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/objectcache/SqlBagOStuff.php
> Line 533: [Error] Bitwise shift by 62 bits
    1 \ 62;


File: /home/reedy/mediawiki/includes/Status.php
> Line 61: [Warning] Possible object property creation during by-reference assignment
    $result->ok =& $sv->ok;
> Line 62: [Warning] Possible object property creation during by-reference assignment
    $result->errors =& $sv->errors;
> Line 63: [Warning] Possible object property creation during by-reference assignment
    $result->value =& $sv->value;
> Line 64: [Warning] Possible object property creation during by-reference assignment
    $result->successCount =& $sv->successCount;
> Line 65: [Warning] Possible object property creation during by-reference assignment
    $result->failCount =& $sv->failCount;
> Line 66: [Warning] Possible object property creation during by-reference assignment
    $result->success =& $sv->success;


File: /home/reedy/mediawiki/includes/htmlform/HTMLForm.php
> Line 958: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/api/ApiAuthManagerHelper.php
> Line 387: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/parser/LinkHolderArray.php
> Line 64: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($nsLinks as &$entry) {
    }
> Line 84: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($nsLinks as &$entry) {
    }


File: /home/reedy/mediawiki/includes/parser/CoreParserFunctions.php
> Line 98: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/parser/Preprocessor_DOM.php
> Line 803: [Warning] Possible object property creation during by-reference assignment
    $this->accum =& $this->rootAccum;
> Line 847: [Warning] Possible object property creation during by-reference assignment
    $this->accum =& $this->rootAccum;


File: /home/reedy/mediawiki/includes/session/PHPSessionHandler.php
> Line 140: [Warning] Check that callbacks that are passed to "session_set_save_handler" and return false or -1 (if any) operate correctly
    session_set_save_handler(self::$instance, true);


File: /home/reedy/mediawiki/includes/filerepo/ForeignDBRepo.php
> Line 134: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/filerepo/ForeignDBViaLBRepo.php
> Line 93: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/libs/rdbms/database/DatabaseMysql.php
> Line 43: [Error] Removed function "mysql_query" called
    mysql_query($sql, $conn);
> Line 45: [Error] Removed function "mysql_unbuffered_query" called
    mysql_unbuffered_query($sql, $conn);
> Line 89: [Error] Removed function "mysql_pconnect" called
    mysql_pconnect($realServer, $this->mUser, $this->mPassword, $connFlags);
> Line 92: [Error] Removed function "mysql_connect" called
    mysql_connect($realServer, $this->mUser, $this->mPassword, true, $connFlags);
> Line 107: [Error] Removed function "mysql_set_charset" called
    mysql_set_charset($charset, $conn);
> Line 119: [Error] Removed function "mysql_close" called
    mysql_close($conn);
> Line 128: [Error] Removed function "mysql_insert_id" called
    mysql_insert_id($conn);
> Line 136: [Error] Removed function "mysql_errno" called
    mysql_errno($this->mConn);
> Line 138: [Error] Removed function "mysql_errno" called
    mysql_errno();
> Line 148: [Error] Removed function "mysql_affected_rows" called
    mysql_affected_rows($conn);
> Line 160: [Error] Removed function "mysql_select_db" called
    mysql_select_db($db, $conn);
> Line 164: [Error] Removed function "mysql_free_result" called
    mysql_free_result($res);
> Line 168: [Error] Removed function "mysql_fetch_object" called
    mysql_fetch_object($res);
> Line 172: [Error] Removed function "mysql_fetch_array" called
    mysql_fetch_array($res);
> Line 176: [Error] Removed function "mysql_num_rows" called
    mysql_num_rows($res);
> Line 180: [Error] Removed function "mysql_num_fields" called
    mysql_num_fields($res);
> Line 184: [Error] Removed function "mysql_fetch_field" called
    mysql_fetch_field($res, $n);
> Line 188: [Error] Removed function "mysql_field_name" called
    mysql_field_name($res, $n);
> Line 192: [Error] Removed function "mysql_field_type" called
    mysql_field_type($res, $n);
> Line 196: [Error] Removed function "mysql_data_seek" called
    mysql_data_seek($res, $row);
> Line 200: [Error] Removed function "mysql_error" called
    mysql_error($conn);
> Line 200: [Error] Removed function "mysql_error" called
    mysql_error();
> Line 206: [Error] Removed function "mysql_real_escape_string" called
    mysql_real_escape_string($s, $conn);


File: /home/reedy/mediawiki/includes/libs/rdbms/database/DBConnRef.php
> Line 163: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/libs/rdbms/database/Database.php
> Line 3206: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/libs/objectcache/MultiWriteBagOStuff.php
> Line 182: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/libs/MWMessagePack.php
> Line 100: [Error] Bitwise shift by 32 bits
    ($value & 1.8446744069414584E+19) >> 32;
> Line 133: [Error] Bitwise shift by 32 bits
    $value >> 32;


File: /home/reedy/mediawiki/includes/libs/jsminplus.php
> Line 1673: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/libs/redis/RedisConnectionPool.php
> Line 314: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($serverConnections as $key => &$connection) {
    }
> Line 398: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($serverConnections as $key => &$connection) {
    }


File: /home/reedy/mediawiki/includes/media/MediaTransformOutput.php
> Line 307: [Warning] Function argument(s) returned by "func_get_arg" might have been modified
    func_get_arg(5);
> Line 309: [Warning] Function argument(s) returned by "func_get_arg" might have been modified
    func_get_arg(4);


File: /home/reedy/mediawiki/includes/media/FormatMetadata.php
> Line 142: [Warning] Possible adding to array on the last iteration of a by-reference foreach loop
    $tags[$tag] = str_pad(intval($h[0] / $h[1]), 2, '0', STR_PAD_LEFT) . ':' . str_pad(intval($m[0] / $m[1]), 2, '0', STR_PAD_LEFT) . ':' . str_pad(intval($s[0] / $s[1]), 2, '0', STR_PAD_LEFT);
> Line 150: [Warning] Possible adding to array on the last iteration of a by-reference foreach loop
    $tags[$tag] = $this->getLanguage()->time($time);
> Line 168: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($vals as &$val) {
    }
> Line 1832: [Warning] Possible adding to array on the last iteration of a by-reference foreach loop
    $arr[$sanitizedKey] = $arr[$key];


File: /home/reedy/mediawiki/includes/specialpage/SpecialPage.php
> Line 749: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/resourceloader/ResourceLoader.php
> Line 1421: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($module[2] as &$dependency) {
    }


File: /home/reedy/mediawiki/includes/cache/localisation/LocalisationCache.php
> Line 504: [Warning] Possible array element creation during by-reference assignment
    $this->data[$primaryCode] =& $this->data[$fallbackCode];
> Line 505: [Warning] Possible array element creation during by-reference assignment
    $this->loadedItems[$primaryCode] =& $this->loadedItems[$fallbackCode];
> Line 506: [Warning] Possible array element creation during by-reference assignment
    $this->loadedSubitems[$primaryCode] =& $this->loadedSubitems[$fallbackCode];


File: /home/reedy/mediawiki/includes/GlobalFunctions.php
> Line 1420: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();
> Line 3003: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();
> Line 3041: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/search/SearchMssql.php
> Line 184: [Warning] String containing number in hexadecimal notation
    '0xEFBBBF';
> Line 204: [Warning] String containing number in hexadecimal notation
    '0xEFBBBF';


File: /home/reedy/mediawiki/includes/exception/MWExceptionHandler.php
> Line 156: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/skins/BaseTemplate.php
> Line 36: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/skins/SkinTemplate.php
> Line 444: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($footerIconsBlock as &$footerIcon) {
    }
> Line 1150: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($links as $key => &$link) {
    }


File: /home/reedy/mediawiki/includes/import/WikiImporter.php
> Line 421: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/SiteConfiguration.php
> Line 587: [Warning] Function argument(s) returned by "func_get_arg" might have been modified
    func_get_arg($i);


File: /home/reedy/mediawiki/includes/specials/SpecialEditWatchlist.php
> Line 103: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/specials/SpecialImport.php
> Line 580: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /home/reedy/mediawiki/includes/specials/SpecialRunJobs.php
> Line 94: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();