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