xref: /PHP-5.3/ext/spl/tests/bug61347.phpt (revision a7639291)
1--TEST--
2Bug #61347 (inconsist isset behavior of Arrayobject)
3--FILE--
4<?php
5$a = array('b' => NULL, 37 => NULL);
6var_dump(isset($a['b'])); //false
7
8$b = new ArrayObject($a);
9var_dump(isset($b['b'])); //false
10var_dump(isset($b[37])); //false
11var_dump(isset($b['no_exists'])); //false
12var_dump(empty($b['b'])); //true
13var_dump(empty($b[37])); //true
14
15var_dump(array_key_exists('b', $b)); //true
16var_dump($b['b']);
17
18$a = array('b' => '', 37 => false);
19$b = new ArrayObject($a);
20var_dump(isset($b['b'])); //true
21var_dump(isset($b[37])); //true
22var_dump(isset($b['no_exists'])); //false
23var_dump(empty($b['b'])); //true
24var_dump(empty($b[37])); //true
25
26
27--EXPECT--
28bool(false)
29bool(false)
30bool(false)
31bool(false)
32bool(true)
33bool(true)
34bool(true)
35NULL
36bool(true)
37bool(true)
38bool(false)
39bool(true)
40bool(true)
41