Extending Exception
| From: | Christoph Boget | Date: | Wed, 21 Jul 2010 15:10:00 +0000 |
| Subject: | Extending Exception | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307066@lists.php.net to get a copy of this message | ||
Ok, so taking the sample code that is on the page
http://us3.php.net/manual/en/language.exceptions.extending.php
Literally, just cutting and pasting the code. When I try to
throw new Exception( 'My Message' );
PHP spits out the following fatal error:
Fatal error: Wrong parameters for Exception([string $exception [, long $code ]])
and the line number it dies on is the line in the
MyException::__construct() where it is calling the parent's
constructor. So what's going on? Is the documentation wrong? Is
this a bug? Am I doing something wrong?
I'm using PHP 5.2.9.
thnx,
Christoph