Re: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_default_classes.c zend_default_classes.h zend_execute.h zend_execute_API.c

From: Date: Tue, 17 Feb 2004 19:22:35 +0000
Subject: Re: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_default_classes.c zend_default_classes.h zend_execute.h zend_execute_API.c
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-7929@lists.php.net to get a copy of this message
Hello Stephane, Tuesday, February 17, 2004, 10:57:02 AM, you wrote: > == Quote from Marcus Boerger (helly@php.net)'s article >> No those are read access members to private property members. When you lok >> at the exception class: >> php -r 'reflection_class::export("exception");' >> then you'll encounter that you can overload __toString() and the >> __construct(). Or in other words you should use 'print $e' or >> '(string)$e' >> or '$e->__toString()'. > If we can only overload __toString() to have different information > displayed (not presentation, but information), the class will be > inconsistent. Moreover, if the exception is not caught, PHP will display > it using the Exception's members, not the overloaded __toString(). You can still add whatever properties you want even in not overloaded exceptions and you can add new methods in overloaded classes. And yes at the moment the exception class generates the presentation only once and ignores the __toString() method when displaying uncaught exceptions. But then again you shouldn't have uncaught exceptions being displayed in any nice fashion. They exist only to help you develop your programs. So still i do not see any reason to change the current behavior - the only thing i could think of is somehow magically add '<pre>' ... '</pre>' to the uncaught exception display facility. -- Best regards, Marcus mailto:helly@php.net

« previous php.internals (#7929) next »