diff options
author | Marcus Boerger <helly@php.net> | 2004-06-27 13:15:31 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-06-27 13:15:31 +0000 |
commit | 46e9abe602e1c584eda3a18cbe2aa737523c94a2 (patch) | |
tree | f38b8e7a0210f63689785b164927383bdb8e56f3 /tests | |
parent | 99b5263afdc2c320434d65c5034d536f9ba555c4 (diff) | |
download | php-git-46e9abe602e1c584eda3a18cbe2aa737523c94a2.tar.gz |
Add more tests
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/lang/038.phpt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt new file mode 100755 index 0000000000..b00728aef1 --- /dev/null +++ b/tests/lang/038.phpt @@ -0,0 +1,41 @@ +--TEST-- +Convert wanrings to exceptions +--FILE-- +<?php + +class MyException extends Exception +{ + function __construct($errstr, $errno, $errfile, $errline) + { + parent::__construct($errstr, $errno); + $this->file = $errfile; + $this->line = $errline; + } +} + +function Error2Exception($errno, $errstr, $errfile, $errline) +{ + throw new ErrorException($errstr, $errno);//, $errfile, $errline); +} + +$err_msg = 'no exception'; +set_error_handler('Error2Exception'); + +try +{ + $con = pg_connect('host=localhost dbname=xtest'); +} +catch (Exception $e) +{ + $trace = $e->getTrace(); + var_dump($trace[0]['function']); + var_dump($trace[1]['function']); +} + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +string(15) "Error2Exception" +string(10) "pg_connect" +===DONE=== |