The topic are "named parameters"

Am 16.10.2010 17:07, schrieb Gregory:
>  What ARE you talking about?
> 
> On 10/16/10 5:55 AM, Reindl Harald wrote:
>>
>> Am 15.10.2010 19:59, schrieb G M:
>>> It's true that you can already do something similar -- although not as 
>>> easily.
>>> I personally always use this pattern:
>> Is it not and your sample is one of the greatest mistakes you can do
>>
>> * At this moment $options will be set to an empty array in the caller
>> * You must use the correct order because $options does not matter
>> * The sample is dangerous for performance and side-effects
>>
>>> function stuff($required1, $required2, $options = array())
>>> {
>>>   extract($options);
>>> }
>> What you can do to make your code readable is the following
>>
>> function stuff($required1, $required2, /**$options*/array())
>> {
>>   extract($options);
>> }
>>
> 

-- 

Mit besten Grüßen, Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
CTO / software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to