Hi!

Well, if we follow that logic (which does make sense), then shouldn't
all magic methods be implicit?  So parent::__sleep/__call/__get/etc
would silently do the default if not defined?

In most cases, you are required to call parent ctor, but there's no such requirement for other methods. Ctors are special in a way that in 99.9% of cases you do call parent ctor. I can't really think of any case where you don't want to do this. Ctors are special (well, along with dtors, but those aren't used as much).

In fact, Java, for example, always inserts parent ctor call if you don't have one and defines empty ctor so it always works. Of course, we don't have to follow them but this shows this pattern is known.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to