Feature request
PHP 8.5 will emit a deprecation notice if null is used as an array offset.
Reproducer:
$array = ['' => 'foo'];
var_dump($array[null]);
var_dump(isset($array[null]));
Output:
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /in/h1Iie on line 5
string(3) "foo"
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /in/h1Iie on line 6
bool(true)
https://3v4l.org/h1Iie/rfc#vgit.master
It would be great if PHPStan would report using null or an expression that can evaluate to null as an array offset so we can track down where our codebase might trigger this new deprecation.
Did PHPStan help you today? Did it make you happy in any way?
It did. 🙂
Feature request
PHP 8.5 will emit a deprecation notice if
nullis used as an array offset.Reproducer:
Output:
https://3v4l.org/h1Iie/rfc#vgit.master
It would be great if PHPStan would report using
nullor an expression that can evaluate tonullas an array offset so we can track down where our codebase might trigger this new deprecation.Did PHPStan help you today? Did it make you happy in any way?
It did. 🙂