Hi!

> However I still wonder what prevents to finally implement named
> parameters too, it will provide the same feature while being even more

For named params, you need to rewrite all args handling, since now it is
a positional array and that doesn't work with named args. On the way
you'd have to refactor zend_parse_parameters to understand named args
(which aren't even named in many internals, so you'd have to add those)
and deal with functions that use + and * in various creative ways and
see how those can be reconciled with named params. And then of course is
the question of by-ref parameters and how to make the syntax handle
those too. Long story short, you'll have to rewrite everything that does
with argument passing, argument receiving or even peeks into arguments.

Skipping parameters is relatively simple - you just put NULL and fix
tons of functions which don't use defaults properly (will need to be
done on a larger scale with named params too, because named params means
you can skip args).

> handy and easier. I could dig the archives but I don't remember what
> was the reason why we rejected the idea back then.

Bikeshedding about the syntax mostly, but that all pales compared to
amount of work that needs to be done in the engine to support named
params. Unless, of course, I'm completely wrong and there's an easy way
to do it, which I am totally missing - in which case please point it out.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to