Hi,

Dominic Grostate wrote:
I think this may have been discussed before, but I was largely dismissed
because no one though it would be possible to implement.

However assuming it is possible, what is the general feeling towards
function overloading, as seen in C# and Java?

Personally, I am against it.

PHP has optional arguments, and it also has dynamic typing. These together eliminate much of the need for overloading.

But there's also the issue of PHP's weak typing. If "123" and 123 dispatch to different methods, that could be a problem.

And, generally, I don't think the added complexity is worth it. In my experience, APIs which make heavy use of overloading are not much fun to use.

Thanks.

--
Andrea Faulds
https://ajf.me/

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

Reply via email to