From: Marcus Boerger Date: Tue, 29 Oct 2002 13:51:44 +0000 (+0000) Subject: Rewrite: Taken from ZE2 RFC + a little textual modification X-Git-Tag: php-4.3.0RC1~461 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0725405d74d239f83bf75c7384e977143b9e5848;p=php Rewrite: Taken from ZE2 RFC + a little textual modification --- diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt index 5f22d52cae..c6970b7bdf 100644 --- a/tests/lang/035.phpt +++ b/tests/lang/035.phpt @@ -1,21 +1,38 @@ --TEST-- ZE2: set_exception_handler() --SKIPIF-- - + --FILE-- error = $_error; + } + + function getException() + { + return $this->error; + } +} -set_exception_handler("my_handler"); -try { - throw new exception(); -} catch (stdClass $e) { - print "BAR\n"; +function ThrowException() +{ + throw new MyException("'This is an exception!'"); } -function my_handler($exception) { - print "FOO\n"; + +try { +} catch (MyException $exception) { + print "There shouldn't be an exception: " . $exception->getException(); + print "\n"; } +try { + ThrowException(); +} catch (MyException $exception) { + print "There was an exception: " . $exception->getException(); + print "\n"; +} ?> --EXPECT-- -FOO +There was an exception: 'This is an exception!'