com php-src: Merge branch 'PHP-5.6' into PHP-7.0: Zend/tests/bug70944.phpt
| From: | Anatol Belski | Date: | Sat, 21 Nov 2015 17:27:43 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6' into PHP-7.0: Zend/tests/bug70944.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89952@lists.php.net to get a copy of this message | ||
Commit: 7d2a26b3fd90fb8ef8ab5d1a7134c370f3be0a78
Author: Xinchen Hui <laruence@gmail.com> Sat, 21 Nov 2015 05:03:20 -0800
Committer: Anatol Belski <ab@php.net> Sat, 21 Nov 2015 18:27:43 +0100
Parents: e4d1ac2c0f9dd0ac0789fe6afff0e3f97dae3bc6
Branches: PHP-7.0.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7d2a26b3fd90fb8ef8ab5d1a7134c370f3be0a78
Log:
Merge branch 'PHP-5.6' into PHP-7..0
Conflicts:
Zend/tests/bug70944.phpt
Zend/zend_exceptions.c
Bugs:
https://bugs.php.net/70944
Changed paths:
M Zend/tests/bug70944.phpt
Diff:
diff --git a/Zend/tests/bug70944.phpt b/Zend/tests/bug70944.phpt
index f14af65..192fd6d 100644
--- a/Zend/tests/bug70944.phpt
+++ b/Zend/tests/bug70944.phpt
@@ -2,15 +2,36 @@
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
--FILE--
<?php
-$e = new Exception("Bar");
try {
- throw new Exception("Foo", 0, $e);
-} finally {
- throw $e;
+ $e = new Exception("Foo");
+ try {
+ throw new Exception("Bar", 0, $e);
+ } finally {
+ throw $e;
+ }
+} catch (Exception $e) {
+ var_dump((string)$e);
+}
+
+try {
+ $e = new Exception("Foo");
+ try {
+ throw new Exception("Bar", 0, $e);
+ } finally {
+ throw new Exception("Dummy", 0, $e);
+ }
+} catch (Exception $e) {
+ var_dump((string)$e);
}
?>
--EXPECTF--
-Fatal error: Uncaught Exception: Bar in %sbug70944.php:%d
+string(%d) "exception 'Exception' with message 'Foo' in %sbug70944.php:%d
+Stack trace:
+#0 {main}"
+string(%d) "exception 'Exception' with message 'Foo' in %sbug70944..php:%d
Stack trace:
#0 {main}
- thrown in %sbug70944.php on line %d
+
+Next exception 'Exception' with message 'Dummy' in %sbug70944.php:%d
+Stack trace:
+#0 {main}"