On 05 November 2003 08:50, Andi Gutmans contributed these pearls of wisdom:

> At 12:33 AM 11/5/2003 +0100, Christian Schneider wrote:
>> I propose to add an alternative (backward compatible) short
>> array creation syntax: $a = [ 1, 2, 3 ]; and $a = [ 'a' =>
>> 42, 'b' => "foo" ];  
> 
> Personally I don't like having two ways of doing things. It
> makes it harder
> for people to read scripts.
> However, I think the proposed syntax is significantly more
> elegant than
> today's array() which makes me think twice about the idea and
> possibly making an exception to the rule. I think it'll
> improve the 
> look of PHP
> scripts. Also I think people calling methods using
> call_user_method([$obj,
> "method"]); will find it sexier than the array() syntax.
> I guess I think it'd be interesting to see what other's think.

I would be greatly in favour of the [] construct.  I've used a number of
languages over the years which feature this kind of syntax (a current
example being JavaScript), and always found the array() syntax clumsy by
comparison.

(And, to answer another thread, personally I don't think it's any more
"magic" than the use of [] to access individual array elements -- and the
two are so clearly related that once you know what one does it would be easy
to guess the meaning of the other.)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

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

Reply via email to