1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00

- Add new test

This commit is contained in:
Marcus Boerger
2004-07-25 19:21:21 +00:00
parent fd83c1ea41
commit 03c19c2b8f
+33
View File
@@ -0,0 +1,33 @@
--TEST--
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";
}
?>
===DONE===
--EXPECT--
Test::__construct(Hello)
Caught Exception(Hello)
===DONE===