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

Last change on this file since 31874 was 31874, checked in by brainslayer, 4 months ago

update php

File size: 462 bytes
Line 
1--TEST--
2Bug #29368.1 (The destructor is called when an exception is thrown from the constructor).
3--FILE--
4<?php
5function throwme($arg)
6{
7    throw new Exception;
8}
9
10class foo {
11  function __construct() {
12    echo "Inside constructor\n";
13    throwme($this);
14  }
15
16  function __destruct() {
17    echo "Inside destructor\n";
18  }
19}
20
21try {
22  $bar = new foo;
23} catch(Exception $exc) {
24  echo "Caught exception!\n";
25}
26?>
27--EXPECT--
28Inside constructor
29Caught exception!
Note: See TracBrowser for help on using the repository browser.