xref: /PHP-7.2/Zend/tests/024.phpt (revision 9b87b73f)
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--
18Notice: Undefined variable: a in %s on line %d
19NULL
20
21Notice: Undefined variable: %s in %s on line %d
22
23Notice: Undefined variable: %s in %s on line %d
24NULL
25
26Notice: Undefined variable: a in %s on line %d
27int(1)
28
29Notice: Undefined variable: %s in %s on line %d
30
31Notice: Undefined variable: %s in %s on line %d
32int(0)
33
34Notice: Undefined variable: a in %s on line %d
35NULL
36
37Notice: Undefined variable: b in %s on line %d
38int(1)
39
40Notice: Trying to get property '1' of non-object in %s on line %d
41NULL
42
43Notice: Trying to get property '1' of non-object in %s on line %d
44NULL
45
46Notice: Undefined variable: c in %s on line %d
47
48Notice: Trying to get property '1' of non-object in %s on line %d
49
50Notice: Trying to get property '' of non-object in %s on line %d
51NULL
52