xref: /PHP-5.6/Zend/tests/isset_003.phpt (revision a953f69e)
1--TEST--
2Testing isset accessing undefined array itens 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
32Notice: Undefined variable: c in %s on line %d
33
34Notice: Undefined variable: d in %s on line %d
35
36Notice: Trying to get property of non-object in %s on line %d
37bool(false)
38bool(true)
39bool(false)
40bool(false)
41