George Bond wrote:
> Then the double-dollar syntax would seem the obvious choice to me:
> foo( $$param => 'whatever' );
> Which is no less readable than anywhere else the double-dollar is
> allowed... :-p
For the simple case I agree having double $$ signs is not that bad, but it
would get nasty for anything other than a simple variable. e.g. if the
param name was in an array:
$searchKeys[] = 'firstParameter'
$searchValues[] = 25;
foo( ${$searchKeys[0]} => $searchValues[0] );
which is definitely less legible than:
foo( $searchKeys[0] => $searchValues[0] );
cheers
Dan
On Fri, Sep 6, 2013 at 6:44 PM, George Bond
<[email protected]>wrote:
> Regarding variable parameter names; if the syntax was:
>
> function foo( $firstParameter ) { ... }
> foo( $firstParameter=> 'foo' );
>
> Then the double-dollar syntax would seem the obvious choice to me:
>
> function foo( $firstParameter ) { ... }
> $param = 'firstParameter';
> foo( $$param => 'whatever' );
>
> Which is no less readable than anywhere else the double-dollar is
> allowed... :-p
>
> --G
>