blob: 949748289232112662778339c3a75ce64e71392a (
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
31
|
--TEST--
ZE2 Do not call destructors if constructor fails
--FILE--
<?php
class Test
{
function __construct($msg) {
echo __METHOD__ . "($msg)\n";
throw new Exception($msg);
}
function __destruct() {
echo __METHOD__ . "\n";
}
}
try
{
$o = new Test('Hello');
unset($o);
}
catch (Exception $e)
{
echo 'Caught ' . get_class($e) . '(' . $e->getMessage() . ")\n";
}
?>
--EXPECT--
Test::__construct(Hello)
Caught Exception(Hello)
|