call_user_func_array() no longer accepts null as a second parameter and calls the function. It now emits a warning and does not call the function.
PHP - Manual: 不向下兼容的变化
2024-04-24
尽管大多数现有的 PHP 5 代码无需改变就可以工作,但是请注意一些不向下兼容的变化:
FALSE
.
PDO::MYSQL_ATTR_READ_DEFAULT_FILE
和
PDO::MYSQL_ATTR_READ_DEFAULT_GROUP
将是未定义的.
以下关键词被保留,将不能被用作函数名, 类名等。
call_user_func_array() no longer accepts null as a second parameter and calls the function. It now emits a warning and does not call the function.
In PHP 5.3, when accessing a string as an array, if the key was a string (non-existing because, for strings, the keys are integers), first char was returned. Probably it converts the string to integer, therefore to 0.
PHP 5.4 throws a warning.
$article; // this holds '98765' but you expect an array
// You try to read a value from your "array"
// PHP 5.3 : nothing
// PHP 5.4 : Warning: Illegal string offset at line ...
$value = $article['id_article'];
var_dump($value); // returns: string(1) "9"
.
strlen changed in 5.3.0. It no longer returns 5 when called on Arrays.
If you abused this in your codebase, beware.
官方地址:https://www.php.net/manual/en/migration53.incompatible.php