blob: 5368cfbd182cae2c8a5a7bdee5ee2c68d0c282de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
--TEST--
Type inference for $ary[$idx]->prop +=
--FILE--
<?php
function test() {
$ary = [];
$ary[0]->y += 2;
var_dump(is_object($ary[0]));
}
try {
test();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined array key 0 in %s on line %d
Attempt to assign property "y" on null
|