Actually nothing could support my point about giving the wrong signals
better than these two postings: They are IMHO on the wrong track on how
to make an interface better.

Krister Karlström wrote:
> This is maybe getting a bit out of topic now, but what about
> function/method overloading using type hinting:
> 
> function myfunc(string $data) { }
> function myfunc(int $data) { }
> function myfunc(myClass $data) { }

<sarcasm>
Go back to Java please ;-)
</sarcasm>

> Arvids Godjuks wrote:
>> 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);

While I think named parameters are a good idea I pointed out in older
postings that I think this is a very crippled approach to it: You still
have to define all the parameters you are going to accept. The real
power and flexibility comes in if you accept (and handle) arbitrary
argument lists.
<plug>
See http://itools.search.ch/ for an example of what I mean.
</plug>

Okay, enough evangelism for today, back to work :-)

- Chris


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

Reply via email to