Annotation of embedaddon/php/ext/spl/tests/bug45622b.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Ensure fix to bug45622 doesn't cause __isset() to be called when ArrayObject::ARRAY_AS_PROPS is used.
! 3: --FILE--
! 4: <?php
! 5: class UsesMagic extends ArrayObject {
! 6: function __get($n) { echo "In " . __METHOD__ . "!\n"; }
! 7: function __set($n, $v) { echo "In " . __METHOD__ . "!\n"; }
! 8: function __isset($n) { echo "In " . __METHOD__ . "!\n"; }
! 9: function __unset($n) { echo "In " . __METHOD__ . "!\n"; }
! 10: }
! 11: $ao = new UsesMagic(array(), ArrayObject::ARRAY_AS_PROPS);
! 12:
! 13: echo "Doesn't trigger __get.\n";
! 14: echo $ao->prop1;
! 15:
! 16: echo "Doesn't trigger __set.\n";
! 17: $ao->prop2 = 'foo';
! 18:
! 19: echo "Doesn't trigger __unset.\n";
! 20: unset($ao->prop3);
! 21:
! 22: echo "Shouldn't trigger __isset.\n";
! 23: isset($ao->prop4);
! 24: ?>
! 25: --EXPECTF--
! 26: Doesn't trigger __get.
! 27:
! 28: Notice: Undefined index: prop1 in %s on line 11
! 29: Doesn't trigger __set.
! 30: Doesn't trigger __unset.
! 31:
! 32: Notice: Undefined index: prop3 in %s on line 17
! 33: Shouldn't trigger __isset.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>