hi,

On Mon, Apr 5, 2010 at 12:07 AM, Stanislav Malyshev <s...@zend.com> wrote:

> 3. Combining named and un-named params can get weird - i.e. foo(1,2,3) is
> simple, foo(1, 2, bar => 3) is doable, but foo(1, 2, bar => 3, 4) would be
> trouble, since it is not clear at all where 4 should go to. Moreover,
> catching this situation can be non-trivial, as right now parsing nested
> function calls may not keep enough context for this.

If we introduce named argument, mixing them should not be weird. An
argument can have both a name and a position, allowing combination of
normal or named arguments. Python's way to do it is very nice and
handy:

http://diveintopython.org/power_of_introspection/optional_arguments.html

I did not look at the parser implementation or limitation lately, but
it would rock if we can use the same syntax than python. It should not
conflict with any existing syntax (foo($a = 1) already works, with
operator precedence). Again, if the parser allows it :)

I also don't see another way to do it than using a hash (or similar
constructs) which will certainly have a significant impact on
performance.

Cheers,
--
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

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

Reply via email to