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