summaryrefslogtreecommitdiff
path: root/Zend/tests/bug26229.phpt
blob: cf23f157f88e7577508e60550c87a00a52164536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Bug #26229 (getIterator() segfaults when it returns arrays or scalars)
--FILE--
<?php

class array_iterator implements IteratorAggregate {
        public function getIterator() {
                return array('foo', 'bar');
        }
}

$obj = new array_iterator;

try
{
	foreach ($obj as $property => $value)
	{
		var_dump($value);
	}
}
catch(Exception $e)
{
	echo $e->getMessage() . "\n";
}
?>
===DONE===
--EXPECT--
Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
===DONE===