mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
a38bad87d5
The immediate error here is the nested indexing in write context, the fact that it's ultimately wrapped in an unset() doesn't matter. Same as $str[0][0] += 1 will throw "Cannot use string offset as an array", so should this case.
36 lines
731 B
PHP
36 lines
731 B
PHP
--TEST--
|
|
Bug #70089 (segfault in PHP 7 at ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER ())
|
|
--FILE--
|
|
<?php
|
|
function dummy($a) {
|
|
}
|
|
|
|
try {
|
|
chr(0)[0][] = 1;
|
|
} catch (Error $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
try {
|
|
unset(chr(0)[0][0]);
|
|
} catch (Error $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
eval("function runtimetest(&\$a) {} ");
|
|
try {
|
|
runtimetest(chr(0)[0]);
|
|
} catch (Error $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
++chr(0)[0];
|
|
} catch (Error $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
string(36) "Cannot use string offset as an array"
|
|
string(36) "Cannot use string offset as an array"
|
|
string(47) "Cannot create references to/from string offsets"
|
|
string(41) "Cannot increment/decrement string offsets"
|