summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/tests/generator_run.phpt
blob: 798d77051e2397a367db2cbae573220af916b732 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Ensure proper saving of EX(opline)
--PHPDBG--
r
q
--EXPECTF--
[Successful compilation of %s]
prompt> caught Generator exception
[Script ended normally]
prompt> 
--FILE--
<?php

function gen() {
	try {
		throw new Exception;
	} catch(Exception $e) {
		yield "caught Generator exception";
	}
}

foreach (gen() as $v) {
	print $v;
}