Merge branch 'PHP-5.5' into PHP-5.6

This commit is contained in:
Nikita Popov 2013-12-01 13:45:22 +01:00
commit b3546e64bd
3 changed files with 6 additions and 0 deletions

View file

@ -4,6 +4,7 @@ Generator::throw() where the exception is caught in the generator
<?php
function gen() {
echo "before yield\n";
try {
yield;
} catch (RuntimeException $e) {
@ -18,6 +19,7 @@ var_dump($gen->throw(new RuntimeException('Test')));
?>
--EXPECTF--
before yield
exception 'RuntimeException' with message 'Test' in %s:%d
Stack trace:
#0 {main}

View file

@ -4,6 +4,7 @@ Generator::throw() where the generator throws a different exception
<?php
function gen() {
echo "before yield\n";
try {
yield;
} catch (RuntimeException $e) {
@ -18,6 +19,7 @@ var_dump($gen->throw(new RuntimeException('throw')));
?>
--EXPECTF--
before yield
Caught: exception 'RuntimeException' with message 'throw' in %s:%d
Stack trace:
#0 {main}

View file

@ -560,6 +560,8 @@ ZEND_METHOD(Generator, throw)
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
zend_generator_ensure_initialized(generator TSRMLS_CC);
if (generator->execute_data) {
/* Throw the exception in the context of the generator */
zend_execute_data *current_execute_data = EG(current_execute_data);