summaryrefslogtreecommitdiff
path: root/Zend/tests/const_dereference_001.phpt
blob: 5fe6e4d4332af14c5595e9dd5e5bd23466386e9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Const array deference
--FILE--
<?php
error_reporting(E_ALL);

var_dump(array(1, 2, 3, 4,) [3]);
var_dump(array(1, 2, 3, 4,) ['foo']);
var_dump(array(array(1,2,3), array(4, 5, 6))[1][2]);

foreach (array(array(1, 2, 3))[0] as $var) {
     echo $var;
}
?>
--EXPECTF--
int(4)

Notice: Undefined index: foo in %sconst_dereference_001.php on line %d
NULL
int(6)
123