xref: /PHP-8.1/Zend/tests/isset_003.phpt (revision d30cd7d7)
1--TEST--
2Testing isset accessing undefined array items and properties
3--FILE--
4<?php
5
6$a = 'foo';
7$b =& $a;
8
9var_dump(isset($b));
10
11var_dump(isset($a[0], $b[1]));
12
13var_dump(isset($a[0]->a));
14
15var_dump(isset($c[0][1][2]->a->b->c->d));
16
17var_dump(isset(${$a}->{$b->{$c[$d]}}));
18
19var_dump(isset($GLOBALS));
20
21var_dump(isset($GLOBALS[1]));
22
23var_dump(isset($GLOBALS[1]->$GLOBALS));
24
25?>
26--EXPECTF--
27bool(true)
28bool(true)
29bool(false)
30bool(false)
31
32Warning: Undefined variable $c in %s on line %d
33
34Warning: Undefined variable $d in %s on line %d
35
36Warning: Trying to access array offset on value of type null in %s on line %d
37
38Warning: Attempt to read property "" on string in %s on line %d
39bool(false)
40bool(true)
41bool(false)
42bool(false)
43