Annotation of embedaddon/php/Zend/tests/bug50255.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #50255 (isset() and empty() silently casts array to object)
! 3: --FILE--
! 4: <?php
! 5:
! 6: $arr = array('foo' => 'bar');
! 7:
! 8: print "isset\n";
! 9: var_dump(isset($arr->foo));
! 10: var_dump(isset($arr->bar));
! 11: var_dump(isset($arr['foo']));
! 12: var_dump(isset($arr['bar']));
! 13: print "empty\n";
! 14: var_dump(empty($arr->foo));
! 15: var_dump(empty($arr->bar));
! 16: var_dump(empty($arr['foo']));
! 17: var_dump(empty($arr['bar']));
! 18:
! 19: ?>
! 20: --EXPECT--
! 21: isset
! 22: bool(false)
! 23: bool(false)
! 24: bool(true)
! 25: bool(false)
! 26: empty
! 27: bool(true)
! 28: bool(true)
! 29: bool(false)
! 30: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>