xref: /PHP-8.3/ext/spl/tests/bug61347.phpt (revision 7aacc705)
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($b['b']);
16
17$a = array('b' => '', 37 => false);
18$b = new ArrayObject($a);
19var_dump(isset($b['b'])); //true
20var_dump(isset($b[37])); //true
21var_dump(isset($b['no_exists'])); //false
22var_dump(empty($b['b'])); //true
23var_dump(empty($b[37])); //true
24?>
25--EXPECT--
26bool(false)
27bool(false)
28bool(false)
29bool(false)
30bool(true)
31bool(true)
32NULL
33bool(true)
34bool(true)
35bool(false)
36bool(true)
37bool(true)
38