> De : Pavel Kouril [mailto:pajou...@gmail.com]
>
> Hello,
> 
> I know this is probably a pretty unpopular opinion in PHP (based on
> the replies I got in the other thread), but different values for
> parameters should be IMHO solved by method overloading and such.

The question is not that it's unpopular, it's that 1. It requires strict types, 
and 2. If we want to solve this by polymorphism, we must also support 
polymorphism on functions. Now, tell me how you would solve the tan(int|float) 
case with polymorphism ? One 'tan' function for int, one for float ? 
str_replace(string|array, string|array, string|array, int &) is also a nice 
case to study if you can't sleep...

Sorry but polymorphism on scalar types is possible with strict types only, 
which is out of scope for the next RFC.

François


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

Reply via email to