summaryrefslogtreecommitdiff
path: root/Zend/tests/temporary_cleaning_009.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/temporary_cleaning_009.phpt')
-rw-r--r--Zend/tests/temporary_cleaning_009.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/Zend/tests/temporary_cleaning_009.phpt b/Zend/tests/temporary_cleaning_009.phpt
new file mode 100644
index 0000000000..c6f747edb5
--- /dev/null
+++ b/Zend/tests/temporary_cleaning_009.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Exception inside a foreach loop with on an object with destructor
+--FILE--
+<?php
+class bar {
+ public $foo = 1;
+ function __destruct() {
+ throw new Exception;
+ }
+}
+
+function foo() {
+ foreach (new bar() as &$foo) {
+ try {
+ $foo = new Exception;
+ return;
+ } catch (Exception $e) {
+ echo "Exception1\n";
+ }
+ }
+}
+try {
+ foo();
+} catch (Exception $e) {
+ echo "Exception2\n";
+}
+?>
+--EXPECT--
+Exception2