On 07.04.2010, at 16:16, Christian Schneider wrote:

my gut feeling also says that we shouldnt allow positional arguments after 
named parameters.
just picking out one of your examples .. 

> foreach (new T_User('firstname' => $firstname, "ORDER BY age") as $user)


couldnt this also be written as:

foreach (new T_User('firstname' => $firstname, "ORDERBY" => "age") as $user)

of course it would be a bit more work when constructing the final query, but 
its tons clearer in terms of knowing how to use the API with just reading one 
use of the API and not the actual implementation.

in the above code what is the purpose of the positional argument? can i just 
"append" what I want? aka is the idea of the API to also support

foreach (new T_User('firstname' => $firstname, "LIMIT 100") as $user)

and

foreach (new T_User('firstname' => $firstname, "ORDER BY age LIMIT 100") as 
$user)

in that case it would still be better to then do:

foreach (new T_User('firstname' => $firstname, 'append' => "ORDER BY age") as 
$user)

.. of course its a few more characters, but its definitely easier to grasp 
whats going on, then having to parse what is named and what is positional.

----

i am trying to remember what killed the discussion last time around. i think it 
was concerns over having to convert all internal functions, but i guess that 
was before we unified the parameter parsing API. IIRC hartmut was quite 
involved in the discussion back then .. maybe he remembers.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org




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

Reply via email to