xref: /PHP-7.2/Zend/tests/generators/bug63066.phpt (revision e97d5fab)
1--TEST--
2Bug #63066 (Calling an undefined method in a generator results in a seg fault)
3--FILE--
4<?php
5function gen($o)
6{
7	yield 'foo';
8	$o->fatalError();
9}
10
11foreach(gen(new stdClass()) as $value)
12	echo $value, "\n";
13--EXPECTF--
14foo
15
16Fatal error: Uncaught Error: Call to undefined method stdClass::fatalError() in %sbug63066.php:5
17Stack trace:
18#0 %s(%d): gen(Object(stdClass))
19#1 {main}
20  thrown in %sbug63066.php on line 5
21