On 08.04.2008, at 12:13, Krister Karlström wrote:
Yes indeed you can implement it using the __call method, but it would be more readable if the language structure itself would support it. I suggested this just because I think that this is the most common way of using overloading, thus this probably would make sense to lot of users out there.

I think polymorphism is exactly the opposite from easier to read. For the bulk of functions I will never need it (even if I am a type hint lover) and so by default I now have to look for all variations of a single method instead of knowing its either that one or its in __call() (well there is also inheritance, but lets now make it any harder for this fairly rare case). This is all a solution to a problem we do not have (but are trying to get with type hints)/

I think type hint's would be good optional functionality. Those who need
will use it, others will not. I'd probably use it in some cases.
Especially
if named parameters are implemented.

Sometimes what I really want is named parameter pass like

function myfunc(array $array, string $string = null, int $someint = 0){
}

myfunc($myArray, someint = $mySomeInt);

Named parameters I see as much more useful, though I generally think that there are ways to ensure that the number of parameters stays small enough to not make named parameters necessary.

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

Reply via email to