php-src/Zend/tests/assign_dim_op_undef.phpt
Nikita Popov 11a9b036a8 Fix duplicate undef warning in assign_dim_op
In case of auto-vivification we were fetching dim twice and as
such also emitting the undef var warning twice.
2021-10-05 15:51:11 +02:00

18 lines
291 B
PHP

--TEST--
Compound array assign with undefined variables
--FILE--
<?php
$a[$b] += 1;
var_dump($a);
?>
--EXPECTF--
Warning: Undefined variable $a in %s on line %d
Warning: Undefined variable $b in %s on line %d
Warning: Undefined array key "" in %s on line %d
array(1) {
[""]=>
int(1)
}