diff options
author | Marcus Boerger <helly@php.net> | 2004-06-27 13:28:01 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-06-27 13:28:01 +0000 |
commit | 91f0369c809d3c6bece07c4a385f5cdce9466f98 (patch) | |
tree | 83aceea325c8e2b439d01f8e871f047514ce7ca3 | |
parent | 46e9abe602e1c584eda3a18cbe2aa737523c94a2 (diff) | |
download | php-git-91f0369c809d3c6bece07c4a385f5cdce9466f98.tar.gz |
Add more tests
-rwxr-xr-x | tests/lang/039.phpt | 45 |
1 files changed, 45 insertions, 0 deletions
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-- +<?php + +interface Catchable +{ +} + +class MyException extends Exception implements Catchable +{ + function __construct($errstr, $errno, $errfile, $errline) + { + parent::__construct($errstr, $errno); + $this->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=== |