On 31.12.2007 15:09, Fredrik Holmström wrote:
>> 2007/12/31, Mikko Koppanen
>> Calling methods without knowing that they exist sounds like a hack to me. 
>> How about using abstract classes or interfaces?
> 
> If you look at, for example, python - calling methods that don't
> *know* exists is common practice, it's not a hack from my point of
> view. It's just easier to ask forgiveness then permission, to quote
> Hopper.
> 
> I never understood the direction PHP is heading with type hinting,
> static binding (SPL-Types?), etc. While I don't directly oppose it I
> don't see any reason for it. I just thought that adding some type of
> ability to handle unknown method calls (without forcing *every* class
> to implement __call() in a specific way) 

There is no need to implement __call() in every class,.
Just make sure their parent class implements it.

Changing PHP's behavior in a backward-incompatible way that would affect 
everyone and *forcing everyone* to use exceptions seems to be really bad 
idea, especially taking into account that your problem can be easily solved 
without it.

-- 
Wbr, 
Antony Dovgal

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

Reply via email to