source: src/router/php7/Zend/tests/generators/return_from_by_ref_generator.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 4 months ago

update php

File size: 215 bytes
Line 
1--TEST--
2Return from by-ref generator
3--FILE--
4<?php
5
6function &gen() {
7    yield;
8    $arr = [42];
9    return $arr[0];
10}
11
12function gen2() {
13    var_dump(yield from gen());
14}
15
16gen2()->next();
17
18?>
19--EXPECT--
20int(42)
Note: See TracBrowser for help on using the repository browser.