From c4dd7a1a684490673e25aaf4fabec5df138854c4 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 14 Mar 2013 05:42:27 +0000 Subject: Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2. --- tests/classes/destructor_and_exceptions.phpt | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tests/classes/destructor_and_exceptions.phpt (limited to 'tests/classes/destructor_and_exceptions.phpt') diff --git a/tests/classes/destructor_and_exceptions.phpt b/tests/classes/destructor_and_exceptions.phpt new file mode 100644 index 0000000..8100c92 --- /dev/null +++ b/tests/classes/destructor_and_exceptions.phpt @@ -0,0 +1,60 @@ +--TEST-- +ZE2 catch exception thrown in destructor +--FILE-- +getMessage() . "\n"; +} + +class FatalException extends Exception +{ + function __construct($what) + { + echo __METHOD__ . "\n"; + $o = new FailClass; + unset($o); + echo "Done: " . __METHOD__ . "\n"; + } +} + +try +{ + throw new FatalException("Damn"); +} +catch(Exception $e) +{ + echo "Caught Exception: " . $e->getMessage() . "\n"; +} +catch(FatalException $e) +{ + echo "Caught FatalException: " . $e->getMessage() . "\n"; +} + +?> +===DONE=== +--EXPECTF-- +FailClass::__destruct +Caught: FailClass +FatalException::__construct +FailClass::__destruct +Caught Exception: FailClass +===DONE=== -- cgit v1.2.1