|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Jul 2015, PHP 5.6.12
+- Core:
+ . Fixed bug #70012 (Exception lost with nested finally block). (Laruence)
+
- CLI server:
. Fixed bug #69655 (php -S changes MKCALENDAR request method to MKCOL). (cmb)
. Fixed bug #64878 (304 responses return Content-Type header). (cmb)
--- /dev/null
+--TEST--
+Bug #70012 (Exception lost with nested finally block)
+--FILE--
+<?php
+try {
+ echo "Outer try\n";
+ try {
+ echo " Middle try\n";
+ throw new Exception();
+ } finally {
+ echo " Middle finally\n";
+ try {
+ echo " Inner try\n";
+ } finally {
+ echo " Inner finally\n";
+ }
+ }
+ echo "Outer shouldnt get here\n";
+} catch (Exception $e) {
+ echo "Outer catch\n";
+} finally {
+ echo "Outer finally\n";
+}
+?>
+--EXPECT--
+Outer try
+ Middle try
+ Middle finally
+ Inner try
+ Inner finally
+Outer catch
+Outer finally
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
}
- EX(fast_ret) = opline;
- EX(delayed_exception) = NULL;
+ if (UNEXPECTED(EX(delayed_exception) != NULL)) {
+ EX(fast_ret) = NULL;
+ } else {
+ EX(fast_ret) = opline;
+ }
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
}
- EX(fast_ret) = opline;
- EX(delayed_exception) = NULL;
+ if (UNEXPECTED(EX(delayed_exception) != NULL)) {
+ EX(fast_ret) = NULL;
+ } else {
+ EX(fast_ret) = opline;
+ }
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
ZEND_VM_CONTINUE();
}