On Mon, Sep 19, 2011 at 3:00 AM, Stas Malyshev <smalys...@sugarcrm.com> wrote: > Hi! > > On 9/18/11 5:42 PM, Pierre Joye wrote: >> >> But this exact example works, only the similar case using abstract >> will fail, and it makes to fail here as an abstract method is only the > > It produces E_STRICT for regular functions, but for some reason not for > ctors, but fatal error for abstract ctors. Quite weird. > >> declaration, the implementation being done in the child class (bar >> extends foo). This is the concept of 'abstract', see it like the >> declaration and implementation in C. The PHP documentation is also > > No, it's not at all like declaration and implementation in C. In C, > declaration and implementation relate to the SAME entity. In PHP, abstract > method and its (multiple, inependent) implementations are different > entities. Moreover, this is prohibited too:
It is the same in C. A class extending an abstract class (or method) does not extend it per se but implement it. Just like the foo(int a, float b); is the declaration (abstract) and foo(int a, float b) { return a * b;= the extended class. This is the basic of abstract methods/classes. > This makes absolutely no sense, as there's no reason why MoreExtendedClass > can't extend domain of ExtendedClass. However, for some reason it is > prohibited. Not willing to understand the declaration idea will only block this thread forever. -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php