mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-5.5' into PHP-5.6
This commit is contained in:
commit
b3546e64bd
3 changed files with 6 additions and 0 deletions
|
@ -4,6 +4,7 @@ Generator::throw() where the exception is caught in the generator
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function gen() {
|
function gen() {
|
||||||
|
echo "before yield\n";
|
||||||
try {
|
try {
|
||||||
yield;
|
yield;
|
||||||
} catch (RuntimeException $e) {
|
} catch (RuntimeException $e) {
|
||||||
|
@ -18,6 +19,7 @@ var_dump($gen->throw(new RuntimeException('Test')));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
before yield
|
||||||
exception 'RuntimeException' with message 'Test' in %s:%d
|
exception 'RuntimeException' with message 'Test' in %s:%d
|
||||||
Stack trace:
|
Stack trace:
|
||||||
#0 {main}
|
#0 {main}
|
||||||
|
|
|
@ -4,6 +4,7 @@ Generator::throw() where the generator throws a different exception
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function gen() {
|
function gen() {
|
||||||
|
echo "before yield\n";
|
||||||
try {
|
try {
|
||||||
yield;
|
yield;
|
||||||
} catch (RuntimeException $e) {
|
} catch (RuntimeException $e) {
|
||||||
|
@ -18,6 +19,7 @@ var_dump($gen->throw(new RuntimeException('throw')));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
before yield
|
||||||
Caught: exception 'RuntimeException' with message 'throw' in %s:%d
|
Caught: exception 'RuntimeException' with message 'throw' in %s:%d
|
||||||
Stack trace:
|
Stack trace:
|
||||||
#0 {main}
|
#0 {main}
|
||||||
|
|
|
@ -560,6 +560,8 @@ ZEND_METHOD(Generator, throw)
|
||||||
|
|
||||||
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
|
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
|
||||||
|
|
||||||
|
zend_generator_ensure_initialized(generator TSRMLS_CC);
|
||||||
|
|
||||||
if (generator->execute_data) {
|
if (generator->execute_data) {
|
||||||
/* Throw the exception in the context of the generator */
|
/* Throw the exception in the context of the generator */
|
||||||
zend_execute_data *current_execute_data = EG(current_execute_data);
|
zend_execute_data *current_execute_data = EG(current_execute_data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue