Annotation of embedaddon/php/ext/spl/tests/array_012.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: ArrayIterator::count
! 3: --FILE--
! 4: <?php
! 5:
! 6: echo "===Array===\n";
! 7:
! 8: $a = array('zero' => 0, 'one' => 1, 'two' => 2);
! 9: $it = new ArrayIterator($a);
! 10:
! 11: var_dump($it->count());
! 12: foreach($it as $key => $val)
! 13: {
! 14: echo "$key=>$val\n";
! 15: var_dump($it->count());
! 16: }
! 17: var_dump($it->count());
! 18:
! 19: echo "===Object===\n";
! 20:
! 21: class test
! 22: {
! 23: public $zero = 0;
! 24: protected $pro;
! 25: public $one = 1;
! 26: private $pri;
! 27: public $two = 2;
! 28: }
! 29:
! 30: $o = new test;
! 31: $it = new ArrayIterator($o);
! 32:
! 33: var_dump($it->count());
! 34: foreach($it as $key => $val)
! 35: {
! 36: echo "$key=>$val\n";
! 37: var_dump($it->count());
! 38: }
! 39: var_dump($it->count());
! 40:
! 41: ?>
! 42: ===DONE===
! 43: <?php exit(0); ?>
! 44: --EXPECT--
! 45: ===Array===
! 46: int(3)
! 47: zero=>0
! 48: int(3)
! 49: one=>1
! 50: int(3)
! 51: two=>2
! 52: int(3)
! 53: int(3)
! 54: ===Object===
! 55: int(3)
! 56: zero=>0
! 57: int(3)
! 58: one=>1
! 59: int(3)
! 60: two=>2
! 61: int(3)
! 62: int(3)
! 63: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>