]> granicus.if.org Git - php/commit
Throw notice on array access on illegal type
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 10 Jul 2019 08:28:58 +0000 (10:28 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 10 Jul 2019 10:02:14 +0000 (12:02 +0200)
commitc42b7dd6d32b43304b76452add158a2ef325d494
tree2f96b8b2a669157a3a519e7cb9a068567b90bbcd
parenta63422029ea2462caf949b7a0b4983e67109d4f2
Throw notice on array access on illegal type

No notice is thrown for list() accesses, because we did not come
to an agreement regarding patterns like

    while ([$key, $value] = yield $it->next()) { ... }

where silent null access may be desirable.

No effort is made to suppress multiple notices in access chains
likes $x[0][0][0], because the technical complexity this causes
does not seem worthwhile.

RFC: https://wiki.php.net/rfc/notice-for-non-valid-array-container
19 files changed:
UPGRADING
UPGRADING.INTERNALS
Zend/tests/024.phpt
Zend/tests/033.phpt
Zend/tests/assign_to_var_003.phpt
Zend/tests/call_user_func_007.phpt
Zend/tests/dereference_002.phpt
Zend/tests/dereference_010.phpt
Zend/tests/dereference_014.phpt
Zend/tests/isset_003.phpt
Zend/tests/offset_bool.phpt
Zend/tests/offset_long.phpt
Zend/tests/offset_null.phpt
Zend/zend_execute.c
ext/spl/tests/array_026.phpt
ext/spl/tests/bug62978.phpt
ext/standard/tests/array/bug31158.phpt
tests/lang/bug25922.phpt
tests/lang/passByReference_003.phpt