summaryrefslogtreecommitdiff
path: root/Zend/tests/bug47771.phpt
blob: c4350b9d95d33ef0c85e863ded46907ca128ca8d (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
28
29
30
--TEST--
Bug #47771 (Exception during object construction from arg call calls object's destructor)
--FILE--
<?php
function throw_exc() {
  throw new Exception('TEST_EXCEPTION');
}

class Test {

  public function __construct() {
    echo 'Constr' ."\n";
  }

  public function __destruct() {
    echo 'Destr' ."\n";
  }

}

try {

  $T =new Test(throw_exc());

} catch( Exception $e) {
  echo 'Exception: ' . $e->getMessage() . "\n";
}
?>
--EXPECT--
Exception: TEST_EXCEPTION