summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/yield_from_already_running.phpt
blob: 16fda983687e8c529e37c998a4b42a4dcb468030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Yielding from the already running Generator should fail (bug #69458)
--FILE--
<?php

function gen() {
	yield from yield;
}

($gen = gen())->send($gen);

?>
--EXPECTF--
Fatal error: Uncaught exception 'EngineException' with message 'Impossible to yield from the Generator being currently run' in %s:%d
Stack trace:
#0 [internal function]: gen()
#1 %s(%d): Generator->send(Object(Generator))
#2 {main}
  thrown in %s on line %d