diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-10 10:28:58 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-10 12:02:14 +0200 |
commit | c42b7dd6d32b43304b76452add158a2ef325d494 (patch) | |
tree | 2f96b8b2a669157a3a519e7cb9a068567b90bbcd /Zend/tests/dereference_002.phpt | |
parent | a63422029ea2462caf949b7a0b4983e67109d4f2 (diff) | |
download | php-git-c42b7dd6d32b43304b76452add158a2ef325d494.tar.gz |
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
Diffstat (limited to 'Zend/tests/dereference_002.phpt')
-rw-r--r-- | Zend/tests/dereference_002.phpt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Zend/tests/dereference_002.phpt b/Zend/tests/dereference_002.phpt index d16e1bb483..7290df7714 100644 --- a/Zend/tests/dereference_002.phpt +++ b/Zend/tests/dereference_002.phpt @@ -69,6 +69,8 @@ array(2) { int(5) } int(1) + +Notice: Trying to access array offset on value of type int in %s on line %d NULL Notice: Undefined offset: 4 in %s on line %d |