helly           Sun Jun 27 09:28:01 2004 EDT

  Added files:                 
    /php-src/tests/lang 039.phpt 
  Log:
  Add more tests
  

http://cvs.php.net/co.php/php-src/tests/lang/039.phpt?r=1.1&p=1
Index: php-src/tests/lang/039.phpt
+++ php-src/tests/lang/039.phpt
--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===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to