On 20.09.2017 at 19:06, ilija.tov...@me.com wrote: > To my surprise, I noticed today that an array access on a `null` value > returns `null` without any warning whatsoever. > Accessing the property of a `null` value gives you a notice, while calling a > function on that `null` value gives you a fatal error. > > https://3v4l.org/ZSZHN > > This is pretty inconsistent. IMO all of these should be fatal errors, > although I realize that might be a bit drastic for PHP 8. > We should at least give the user a notice when using array access on a `null` > value.
There is already a respective RFC[1] which has been accepted for PHP 7.2, but there are issues[2]. [1] <https://wiki.php.net/rfc/notice-for-non-valid-array-container> [2] <http://news.php.net/php.internals/97520> -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php