Re: beta2, deriving from class Extension and calling parent::__toString() segfaults

From: Date: Sat, 29 Nov 2003 17:09:36 +0000
Subject: Re: beta2, deriving from class Extension and calling parent::__toString() segfaults
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-5803@lists.php.net to get a copy of this message
Hello Markus, this works now. regards marcus (the other one) Saturday, November 29, 2003, 3:39:17 PM, you wrote: > When trying to derive from class Exception and access the 'string' > property or call 'parent::__toString' PHP segfaults: > <?php > class MyException extends Exception { > function __toString() { > var_dump($this->string); > } > } > throw new MyException("hmm"); ?>> > Output: > $ php testException.php > NULL > Segmentation fault > Or this example: > <?php > class MyException extends Exception { > function __toString() { > parent::__toString(); > } > } > throw new MyException("hmm"); ?>> > Output: > $ php testException.php > Segmentation fault > The need for this came up when I saw that the reported exception is > not foramted in the HTML output; it's quite hard next to impossible > to properly read the stack trace. So my goal was to make my own > exception and call nl2br() on the string returned from the class. > Besides the segfaults above, is there a chance we have a nicer HTML > formatting for reported Exceptions (while still strip those HTML > tags from it for logging)? > - Markus -- Best regards, Marcus mailto:helly@php.net

« previous php.internals (#5803) next »