Hello,

the example of the section "Exceptions" of document

http://www.php.net/zend-engine-2.php

in Windows does not work:

 

Fatal error: Call to undefined method exception::__construct() in
c:\appserv\www\php5\exception.php on line 4

 

this works:

 

<?php

class MyExceptionFoo extends Exception {

    function __construct($exception) {

        parent::Exception($exception);     // modified line

    }

}

 

try {

    throw new MyExceptionFoo("Hello");

} catch (MyExceptionFoo $exception) {         // modified line

    print $exception->getMessage();

}

?>

 

Reply via email to