xref: /PHP-7.4/Zend/tests/offset_long.phpt (revision c42b7dd6)
1--TEST--
2using different variables to access long offsets
3--FILE--
4<?php
5
6$long = 1;
7
8var_dump($long[1]);
9var_dump($long[0.0836]);
10var_dump($long[NULL]);
11var_dump($long["run away"]);
12
13var_dump($long[TRUE]);
14var_dump($long[FALSE]);
15
16$fp = fopen(__FILE__, "r");
17var_dump($long[$fp]);
18
19$obj = new stdClass;
20var_dump($long[$obj]);
21
22$arr = Array(1,2,3);
23var_dump($long[$arr]);
24
25echo "Done\n";
26?>
27--EXPECTF--
28Notice: Trying to access array offset on value of type int in %s on line %d
29NULL
30
31Notice: Trying to access array offset on value of type int in %s on line %d
32NULL
33
34Notice: Trying to access array offset on value of type int in %s on line %d
35NULL
36
37Notice: Trying to access array offset on value of type int in %s on line %d
38NULL
39
40Notice: Trying to access array offset on value of type int in %s on line %d
41NULL
42
43Notice: Trying to access array offset on value of type int in %s on line %d
44NULL
45
46Notice: Trying to access array offset on value of type int in %s on line %d
47NULL
48
49Notice: Trying to access array offset on value of type int in %s on line %d
50NULL
51
52Notice: Trying to access array offset on value of type int in %s on line %d
53NULL
54Done
55