Jared White wrote:
Named arguments are absolutely essential for using PHP as a solid templating language, and, in fact, they also greatly enhance code readability for complex method calls of in-depth APIs.

I agree.

As useful functions tend to increase in complexity over time, often so does the number of parameters.

It soon gets to the point where function calls look like:
foo(true, false, false, false, false, true)
The rest of the parameters being required to be supplied, with their default value, when the user is only interested in changing the last option.

Sure, you can fall back to associative array parsing. However, I feel it lacks the rigor that named parameters can give. Named parameters also give a clean method for the user to see the available options, rather than reading through source code.

I'd really like this issue to be given more consideration. It's been brought up consistently over the last couple of years, in some cases rather passionately (I believe someone wanted to fork PHP over this a while back). We have a long time before a PHP6 release, this is the ideal time to discuss implementation.

Kind regards,
Aidan Lister

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

Reply via email to