mirror of
https://github.com/php/php-src.git
synced 2024-12-17 22:09:12 +08:00
2354aa9676
Weirdly these warnings had zero coverage previously... Remove an incorrect exception checking optimization: The key lookup may throw (it could also throw previously, though only through a custom error handler).
28 lines
473 B
PHP
28 lines
473 B
PHP
--TEST--
|
|
Using unset(), isset(), empty() with an illegal array offset throws
|
|
--FILE--
|
|
<?php
|
|
|
|
$ary = [];
|
|
try {
|
|
unset($ary[[]]);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
isset($ary[[]]);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
empty($ary[[]]);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Illegal offset type in unset
|
|
Illegal offset type in isset or empty
|
|
Illegal offset type in isset or empty
|