RE: [PHP-DEV] A misleading error message
| From: | Wez Furlong | Date: | Thu, 13 May 2004 21:56:22 +0000 |
| Subject: | RE: [PHP-DEV] A misleading error message | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9851@lists.php.net to get a copy of this message | ||
The message is correct; Two is abstract since you haven't implemented a
"real" version of bar().
--Wez.
> With 5RC2 the following code produces a the fatal error
> "Cannot instantiate
> abstract class Two." In fact Two is not an abstract class,
> so the wording
> tripped me up for a minute.
>
> The error actually occurs because Two doesn't implement all of One's
> abstract methods. Could someone make a change to the error message?
>
> <?php
>
> abstract class One {
> abstract function foo();
> abstract function bar();
> }
>
> class Two extends One {
> public function foo() {}
> }
>
> new Two;
>
> ?>