xref: /PHP-8.3/Zend/tests/024.phpt (revision 7936c808)
1--TEST--
2Testing operations with undefined variable
3--FILE--
4<?php
5
6var_dump($a[1]);
7var_dump($a[$c]);
8var_dump($a + 1);
9var_dump($a + $b);
10var_dump($a++);
11var_dump(++$b);
12var_dump($a->$b);
13var_dump($a->$b);
14var_dump($a->$b->{$c[1]});
15
16?>
17--EXPECTF--
18Warning: Undefined variable $a in %s on line %d
19
20Warning: Trying to access array offset on null in %s on line %d
21NULL
22
23Warning: Undefined variable $a in %s on line %d
24
25Warning: Undefined variable $c in %s on line %d
26
27Warning: Trying to access array offset on null in %s on line %d
28NULL
29
30Warning: Undefined variable $a in %s on line %d
31int(1)
32
33Warning: Undefined variable $a in %s on line %d
34
35Warning: Undefined variable $b in %s on line %d
36int(0)
37
38Warning: Undefined variable $a in %s on line %d
39NULL
40
41Warning: Undefined variable $b in %s on line %d
42int(1)
43
44Warning: Attempt to read property "1" on int in %s on line %d
45NULL
46
47Warning: Attempt to read property "1" on int in %s on line %d
48NULL
49
50Warning: Undefined variable $c in %s on line %d
51
52Warning: Trying to access array offset on null in %s on line %d
53
54Warning: Attempt to read property "1" on int in %s on line %d
55
56Warning: Attempt to read property "" on null in %s on line %d
57NULL
58