1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00
Files
archived-php-src/Zend/tests/try/catch_004.phpt
T
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

42 lines
481 B
PHP

--TEST--
Catching an exception in a constructor inside a static method
--FILE--
<?php
class MyObject
{
function fail()
{
throw new Exception();
}
function __construct()
{
self::fail();
echo __METHOD__ . "() Must not be reached\n";
}
function __destruct()
{
echo __METHOD__ . "() Must not be called\n";
}
static function test()
{
try
{
new MyObject();
}
catch(Exception $e)
{
echo "Caught\n";
}
}
}
MyObject::test();
?>
--EXPECT--
Caught