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