I ran the linter from https://github.com/sstalle/php7cc on MW core and got a pile of warnings. We need to sort them and fix those that matter. The most popular problem appears to be the modification of results returned by `func_get_args()` and friends.
```
File: /vagrant/mediawiki/includes/WebResponse.php
> Line 92: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg(4);
> Line 95: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg(5);
> Line 231: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg(4);
> Line 234: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg(5);
File: /vagrant/mediawiki/includes/Block.php
> Line 124: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/cache/LocalisationCache.php
> Line 508: Possible array element creation during by-reference assignment
$this->data[$primaryCode] =& $this->data[$fallbackCode];
> Line 509: Possible array element creation during by-reference assignment
$this->loadedItems[$primaryCode] =& $this->loadedItems[$fallbackCode];
> Line 510: Possible array element creation during by-reference assignment
$this->loadedSubitems[$primaryCode] =& $this->loadedSubitems[$fallbackCode];
File: /vagrant/mediawiki/includes/clientpool/RedisConnectionPool.php
> Line 313: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($serverConnections as $key => &$connection) {
}
> Line 412: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($serverConnections as $key => &$connection) {
}
File: /vagrant/mediawiki/includes/db/Database.php
> Line 1134: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 3830: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/db/DatabaseMysql.php
> Line 39: Removed function "mysql_query" called
mysql_query($sql, $conn);
> Line 41: Removed function "mysql_unbuffered_query" called
mysql_unbuffered_query($sql, $conn);
> Line 85: Removed function "mysql_pconnect" called
mysql_pconnect($realServer, $this->mUser, $this->mPassword, $connFlags);
> Line 88: Removed function "mysql_connect" called
mysql_connect($realServer, $this->mUser, $this->mPassword, true, $connFlags);
> Line 103: Removed function "mysql_set_charset" called
mysql_set_charset($charset, $conn);
> Line 115: Removed function "mysql_close" called
mysql_close($conn);
> Line 124: Removed function "mysql_insert_id" called
mysql_insert_id($conn);
> Line 132: Removed function "mysql_errno" called
mysql_errno($this->mConn);
> Line 134: Removed function "mysql_errno" called
mysql_errno();
> Line 144: Removed function "mysql_affected_rows" called
mysql_affected_rows($conn);
> Line 156: Removed function "mysql_select_db" called
mysql_select_db($db, $conn);
> Line 160: Removed function "mysql_free_result" called
mysql_free_result($res);
> Line 164: Removed function "mysql_fetch_object" called
mysql_fetch_object($res);
> Line 168: Removed function "mysql_fetch_array" called
mysql_fetch_array($res);
> Line 172: Removed function "mysql_num_rows" called
mysql_num_rows($res);
> Line 176: Removed function "mysql_num_fields" called
mysql_num_fields($res);
> Line 180: Removed function "mysql_fetch_field" called
mysql_fetch_field($res, $n);
> Line 184: Removed function "mysql_field_name" called
mysql_field_name($res, $n);
> Line 188: Removed function "mysql_field_type" called
mysql_field_type($res, $n);
> Line 192: Removed function "mysql_data_seek" called
mysql_data_seek($res, $row);
> Line 196: Removed function "mysql_error" called
mysql_error($conn);
> Line 196: Removed function "mysql_error" called
mysql_error();
> Line 202: Removed function "mysql_real_escape_string" called
mysql_real_escape_string($s, $conn);
> Line 208: Removed function "mysql_ping" called
mysql_ping($conn);
File: /vagrant/mediawiki/includes/debug/logger/monolog/AvroFormatter.php
> Line 182: Bitwise shift by 32 bits
($id & 1.8446744069414584E+19) >> 32;
File: /vagrant/mediawiki/includes/exception/MWExceptionHandler.php
> Line 208: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/filerepo/ForeignDBRepo.php
> Line 128: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/filerepo/ForeignDBViaLBRepo.php
> Line 91: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/GlobalFunctions.php
> Line 1506: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 1522: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 1556: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 1579: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 1681: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 1702: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 1736: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 2659: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 3470: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
> Line 3507: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/Import.php
> Line 404: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/libs/jsminplus.php
> Line 1675: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/libs/MWMessagePack.php
> Line 100: Bitwise shift by 32 bits
($value & 1.8446744069414584E+19) >> 32;
> Line 133: Bitwise shift by 32 bits
$value >> 32;
File: /vagrant/mediawiki/includes/libs/objectcache/MultiWriteBagOStuff.php
> Line 188: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/logging/LogPage.php
> Line 298: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/mail/UserMailer.php
> Line 125: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg(5);
File: /vagrant/mediawiki/includes/media/FormatMetadata.php
> Line 141: 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 149: Possible adding to array on the last iteration of a by-reference foreach loop
$tags[$tag] = $this->getLanguage()->time($time);
> Line 167: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($vals as &$val) {
}
> Line 1823: Possible adding to array on the last iteration of a by-reference foreach loop
$arr[$sanitizedKey] = $arr[$key];
File: /vagrant/mediawiki/includes/media/MediaTransformOutput.php
> Line 307: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg(5);
> Line 309: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg(4);
File: /vagrant/mediawiki/includes/objectcache/ObjectCacheSessionHandler.php
> Line 40: Check that callbacks that are passed to "session_set_save_handler" and return false or -1 (if any) operate correctly
session_set_save_handler(array(__CLASS__, 'open'), array(__CLASS__, 'close'), array(__CLASS__, 'read'), array(__CLASS__, 'write'), array(__CLASS__, 'destroy'), array(__CLASS__, 'gc'));
File: /vagrant/mediawiki/includes/objectcache/SqlBagOStuff.php
> Line 480: Bitwise shift by 62 bits
1 << 62;
File: /vagrant/mediawiki/includes/parser/CoreParserFunctions.php
> Line 97: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/parser/LinkHolderArray.php
> Line 64: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($nsLinks as &$entry) {
}
> Line 84: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($nsLinks as &$entry) {
}
File: /vagrant/mediawiki/includes/parser/Preprocessor_DOM.php
> Line 738: Possible object property creation during by-reference assignment
$this->accum =& $this->rootAccum;
> Line 782: Possible object property creation during by-reference assignment
$this->accum =& $this->rootAccum;
File: /vagrant/mediawiki/includes/resourceloader/ResourceLoader.php
> Line 1320: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($module[2] as &$dependency) {
}
File: /vagrant/mediawiki/includes/search/SearchMssql.php
> Line 184: String containing number in hexadecimal notation
'0xEFBBBF';
> Line 204: String containing number in hexadecimal notation
'0xEFBBBF';
File: /vagrant/mediawiki/includes/SiteConfiguration.php
> Line 593: Function argument(s) returned by "func_get_arg" might have been modified
func_get_arg($i);
File: /vagrant/mediawiki/includes/skins/SkinTemplate.php
> Line 409: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($footerIconsBlock as &$footerIcon) {
}
> Line 1089: Nested by-reference foreach loop, make sure there is no iteration over the same array
foreach ($links as $key => &$link) {
}
File: /vagrant/mediawiki/includes/specialpage/SpecialPage.php
> Line 607: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/specials/SpecialEditWatchlist.php
> Line 79: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/specials/SpecialImport.php
> Line 568: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/includes/Status.php
> Line 62: Possible object property creation during by-reference assignment
$this->value =& $this->sv->value;
> Line 63: Possible object property creation during by-reference assignment
$this->successCount =& $this->sv->successCount;
> Line 64: Possible object property creation during by-reference assignment
$this->failCount =& $this->sv->failCount;
> Line 65: Possible object property creation during by-reference assignment
$this->success =& $this->sv->success;
File: /vagrant/mediawiki/tests/phpunit/includes/api/query/ApiQueryTestBase.php
> Line 43: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/tests/phpunit/maintenance/MaintenanceTest.php
> Line 83: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
File: /vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php
> Line 825: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();