Re: beta2, deriving from class Extension and calling parent::__toString() segfaults
| From: | Markus Fischer | Date: | Sun, 30 Nov 2003 07:17:49 +0000 |
| Subject: | Re: beta2, deriving from class Extension and calling parent::__toString() segfaults | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-5807@lists.php.net to get a copy of this message | ||
Hi Marcus,
On Sat, Nov 29, 2003 at 06:09:36PM +0100, Marcus Boerger wrote :
> Hello Markus,
>
> this works now.
>
> regards
> marcus (the other one)
Thanks, calling parent::__toString() or accessing $this->string
works now. I've found just another scenario which causes a segfault.
If you do not return anything from __toString() or return int or an
object, php segfaults:
<?php
class MyException extends Exception {
function __toString() {
# segfault
#return 1;
# segfault
#return new StdClass
# no segfault
#return array("foo");
# segfault (no return statement)
}
}
throw new MyException("hmm");
?>
Output:
$ php testException.php
Segmentation fault
- Markus