php-src/Zend/tests/func_arg_fetch_optimization.phpt
Nikita Popov 2e29817005 Handle FETCH_DIM_R after FETCH_DIM_FUNC_ARG in inference
This can happen if a call is optimized, but FETCH_DIM_FUNC_ARG
cannot be converted to FETCH_DIM_R because it uses an UNUSED op2,
which is not supported by FETCH_DIM_R.

Fixes oss-fuzz 6144185837682688.
2021-11-01 14:26:36 +01:00

16 lines
260 B
PHP

--TEST--
FETCH_DIM_FUNC_ARG that cannot be optimized to FETCH_DIM_R because it appends
--FILE--
<?php
function test($x) {
test($x[][$y]);
}
try {
test([]);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot use [] for reading