1--TEST--
2Printing the stack trace in a generator
3--FILE--
4<?php
5
6function f1() {
7    debug_print_backtrace();
8}
9
10function f2($arg1, $arg2) {
11    f1();
12    yield; // force generator
13}
14
15function f3($gen) {
16    $gen->rewind(); // trigger run
17}
18
19$gen = f2('foo', 'bar');
20f3($gen);
21
22?>
23--EXPECTF--
24#0  f1() called at [%s:%d]
25#1  f2(foo, bar)
26#2  Generator->rewind() called at [%s:%d]
27#3  f3(Generator Object ()) called at [%s:%d]
28