mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
30 lines
545 B
PHP
Executable File
30 lines
545 B
PHP
Executable File
--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===
|
|
--EXPECTF--
|
|
Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
|
|
===DONE===
|