summaryrefslogtreecommitdiff
path: root/Zend/tests/temporary_cleaning_009.phpt
blob: 32a84a6ffdac65ea8a77ff7ff144413959e7267e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
Live range & free on return
--FILE--
<?php
class bar {
        public $foo = 1;
        public $bar = 1;

        function __destruct() {
                throw $this->foo;
        }
}
foreach (new bar as &$foo) {
        try {
                $foo = new Exception;
                return; // frees the loop variable
        } catch (Exception $e) {
                echo "exception\n";
        }
}
echo "end\n";
?>
--EXPECTF--
Fatal error: Uncaught Exception in %stemporary_cleaning_009.php:12
Stack trace:
#0 {main}
  thrown in %stemporary_cleaning_009.php on line 12