Annotation of embedaddon/php/Zend/tests/bug26229.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #26229 (getIterator() segfaults when it returns arrays or scalars)
! 3: --FILE--
! 4: <?php
! 5:
! 6: class array_iterator implements IteratorAggregate {
! 7: public function getIterator() {
! 8: return array('foo', 'bar');
! 9: }
! 10: }
! 11:
! 12: $obj = new array_iterator;
! 13:
! 14: try
! 15: {
! 16: foreach ($obj as $property => $value)
! 17: {
! 18: var_dump($value);
! 19: }
! 20: }
! 21: catch(Exception $e)
! 22: {
! 23: echo $e->getMessage() . "\n";
! 24: }
! 25: ?>
! 26: ===DONE===
! 27: --EXPECTF--
! 28: Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
! 29: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>