summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/throw_uncaught.phpt
blob: 73f59094ca15b84fcfee7cdc32c67d4b27f0f99e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Generator::throw() where the exception is not caught in the generator
--FILE--
<?php

function gen() {
    yield 'thisThrows';
    yield 'notReached';
}

$gen = gen();
var_dump($gen->throw(new RuntimeException('test')));

?>
--EXPECTF--
Fatal error: Uncaught RuntimeException: test in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d