mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +02:00
18 lines
277 B
PHP
18 lines
277 B
PHP
--TEST--
|
|
yield from with an IteratorAggregate
|
|
--FILE--
|
|
<?php
|
|
class foo implements \IteratorAggregate {
|
|
public $prop = 1;
|
|
function getIterator(): Traversable {
|
|
var_dump($this->prop);
|
|
yield;
|
|
}
|
|
}
|
|
(function(){
|
|
yield from new foo;
|
|
})()->next();
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|