source: src/router/php7/Zend/tests/temporary_cleaning_009.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

File size: 577 bytes
Line 
1--TEST--
2Live range & free on return
3--FILE--
4<?php
5class bar {
6        public $foo = 1;
7        public $bar = 1;
8
9        function __destruct() {
10                throw $this->foo;
11        }
12}
13foreach (new bar as &$foo) {
14        try {
15                $foo = new Exception;
16                return; // frees the loop variable
17        } catch (Exception $e) {
18                echo "exception\n";
19        }
20}
21echo "end\n";
22?>
23--EXPECTF--
24Fatal error: Uncaught Exception in %stemporary_cleaning_009.php:12
25Stack trace:
26#0 {main}
27  thrown in %stemporary_cleaning_009.php on line 12
Note: See TracBrowser for help on using the repository browser.