Annotation of embedaddon/php/ext/spl/tests/observer_008.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: SplObjectStorage addAll/removeAll
! 3: --FILE--
! 4: <?php
! 5: class A extends SplObjectStorage { }
! 6:
! 7: $o1 = new StdClass;
! 8: $o2 = new StdClass;
! 9: $o3 = new StdClass;
! 10:
! 11: $a = new A;
! 12: $a->attach($o1);
! 13: $a->attach($o2);
! 14:
! 15: $b = new SplObjectSTorage();
! 16: $b->attach($o2);
! 17: $b->attach($o3);
! 18:
! 19: $a->addAll($b);
! 20:
! 21: var_dump($a->count());
! 22:
! 23: $a->detach($o3);
! 24: var_dump($a->count());
! 25:
! 26: $a->removeAll($b);
! 27: var_dump($a->count());
! 28: ?>
! 29: ===DONE===
! 30: <?php exit(0); ?>
! 31: --EXPECTF--
! 32: int(3)
! 33: int(2)
! 34: int(1)
! 35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>