Annotation of embedaddon/php/ext/spl/tests/bug53515.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #53515 (property_exists incorrect on ArrayObject null and 0 values)
! 3: --FILE--
! 4: <?php
! 5:
! 6: $a = array('a' => 1, 'b'=> true, 'c' => 0, 'd' => null, 'e' => false, 'f' => array());
! 7: $o = new ArrayObject($a, ArrayObject::ARRAY_AS_PROPS);
! 8:
! 9: $a['z'] = '';
! 10: $a[''] = '';
! 11:
! 12: foreach ($a as $key => $value) {
! 13: echo $key . ': ' . (is_null($value) ? 'null' : $value) .
! 14: ' array_key_exists: ' . (array_key_exists($key, $a) ? 'true' : 'false') .
! 15: ' property_exists: ' . (property_exists($o, $key) ? 'true' : 'false'),"\n";
! 16: }
! 17:
! 18: ?>
! 19: --EXPECT--
! 20: a: 1 array_key_exists: true property_exists: true
! 21: b: 1 array_key_exists: true property_exists: true
! 22: c: 0 array_key_exists: true property_exists: true
! 23: d: null array_key_exists: true property_exists: true
! 24: e: array_key_exists: true property_exists: true
! 25: f: Array array_key_exists: true property_exists: true
! 26: z: array_key_exists: true property_exists: false
! 27: : array_key_exists: true property_exists: false
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>