Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5803 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91395 invoked by uid 1010); 29 Nov 2003 17:09:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91354 invoked from network); 29 Nov 2003 17:09:30 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 29 Nov 2003 17:09:30 -0000 Received: from [192.168.1.100] (p508EB77C.dip.t-dialin.net [80.142.183.124]) by shiva.mind.de (Postfix) with ESMTP id 27ED397B64; Sat, 29 Nov 2003 18:09:24 +0100 (CET) Date: Sat, 29 Nov 2003 18:09:36 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <31603267000.20031129180936@marcus-boerger.de> To: Markus Fischer Cc: internals@lists.php.net In-Reply-To: <20031129143917.GA11269@gjat.josefine.at> References: <20031129143917.GA11269@gjat.josefine.at> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] beta2, deriving from class Extension and calling parent::__toString() segfaults From: helly@php.net (Marcus Boerger) 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: > class MyException extends Exception { > function __toString() { > var_dump($this->string); > } > } > throw new MyException("hmm"); ?>> > Output: > $ php testException.php > NULL > Segmentation fault > Or this example: > 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