From: Marcus Boerger Date: Sun, 27 Jun 2004 13:28:01 +0000 (+0000) Subject: Add more tests X-Git-Tag: php-5.0.0~114 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91f0369c809d3c6bece07c4a385f5cdce9466f98;p=php Add more tests --- diff --git a/tests/lang/039.phpt b/tests/lang/039.phpt new file mode 100755 index 0000000000..dca2ca5f6d --- /dev/null +++ b/tests/lang/039.phpt @@ -0,0 +1,45 @@ +--TEST-- +Catch Interfaces +--FILE-- +file = $errfile; + $this->line = $errline; + } +} + +function Error2Exception($errno, $errstr, $errfile, $errline) +{ + throw new MyException($errstr, $errno, $errfile, $errline); +} + +$err_msg = 'no exception'; +set_error_handler('Error2Exception'); + +try +{ + $con = pg_connect('host=localhost dbname=xtest'); +} +catch (Catchable $e) +{ + echo "Catchable\n"; +} +catch (Exception $e) +{ + echo "Exception\n"; +} + +?> +===DONE=== +--EXPECTF-- +Catchable +===DONE===