cvs: ZendEngine2 / ZEND_CHANGES

From: Date: Sun, 22 Feb 2004 18:50:47 +0000
Subject: cvs: ZendEngine2 / ZEND_CHANGES
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2387@lists.php.net to get a copy of this message
helly Sun Feb 22 13:50:47 2004 EDT Modified files: /ZendEngine2 ZEND_CHANGES Log: Add some more obviously needed information http://cvs.php.net/diff.php/ZendEngine2/ZEND_CHANGES?r1=1.78&r2=1.79&ty=u Index: ZendEngine2/ZEND_CHANGES diff -u ZendEngine2/ZEND_CHANGES:1.78 ZendEngine2/ZEND_CHANGES:1.79 --- ZendEngine2/ZEND_CHANGES:1.78 Mon Feb 16 07:08:20 2004 +++ ZendEngine2/ZEND_CHANGES Sun Feb 22 13:50:47 2004 @@ -596,6 +596,32 @@ If you derive your exception classes from this Exception base class your exceptions will be nicely shown in the builtin handler for uncaught exceptions. + + Note: The method getMessage() is a final read only access method to + the private proeprty message that is set in the constructor. If you + feel a need to overwrite the exception display then overload method + __toString() in your derived class or implement your own extneral + exception display function to accomplish your desired formatting. + + Example: + + <?php + function display_exception(Exception $ex) + { + echo 'Exception: ' . $ex->getMessage() . 'with backtrace: <pre>'; + echo $ex->getTrace(); + echo '</pre>'; + } + + try + { + // your code here + } + catch (Exception $ex) + { + display_exeption($ex); + } + ?> * Dereferencing objects returned from functions.

« previous php.zend-engine.cvs (#2387) next »