mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
21 lines
498 B
PHP
21 lines
498 B
PHP
--TEST--
|
|
RecursiveIteratorIterator constructor should thrown if IteratorAggregate does not return Iterator
|
|
--FILE--
|
|
<?php
|
|
|
|
class MyIteratorAggregate implements IteratorAggregate {
|
|
#[ReturnTypeWillChange]
|
|
function getIterator() {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
try {
|
|
new RecursiveIteratorIterator(new MyIteratorAggregate);
|
|
} catch (LogicException $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
MyIteratorAggregate::getIterator() must return an object that implements Traversable
|