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/024.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/024.phpt')
-rw-r--r-- | Zend/tests/024.phpt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Zend/tests/024.phpt b/Zend/tests/024.phpt index 34dac0f1e3..9e647d4231 100644 --- a/Zend/tests/024.phpt +++ b/Zend/tests/024.phpt @@ -16,19 +16,23 @@ var_dump($a->$b->{$c[1]}); ?> --EXPECTF-- Notice: Undefined variable: a in %s on line %d + +Notice: Trying to access array offset on value of type null in %s on line %d NULL -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: a in %s on line %d + +Notice: Undefined variable: c in %s on line %d -Notice: Undefined variable: %s in %s on line %d +Notice: Trying to access array offset on value of type null in %s on line %d NULL Notice: Undefined variable: a in %s on line %d int(1) -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: a in %s on line %d -Notice: Undefined variable: %s in %s on line %d +Notice: Undefined variable: b in %s on line %d int(0) Notice: Undefined variable: a in %s on line %d @@ -45,6 +49,8 @@ NULL Notice: Undefined variable: c in %s on line %d +Notice: Trying to access array offset on value of type null in %s on line %d + Notice: Trying to get property '1' of non-object in %s on line %d Notice: Trying to get property '' of non-object in %s on line %d |