Re: RFC: Short syntax for Arrays (redux)
| From: | Michael Shadle | Date: | Wed, 01 Jun 2011 21:39:42 +0000 |
| Subject: | Re: RFC: Short syntax for Arrays (redux) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52708@lists.php.net to get a copy of this message | ||
First, why not go the opposite way and standardize the syntax - why
not make object() or Object() work like array() or Array()?
$person = object('name' => 'Justin',
'city' => 'ogden',
'state' => 'ut',
'country' => 'usa',
'favoriteNumbers' => array(4, 12, 37, 42),
'unluckyNumbers' => array(6, 13, 21),
'likesPhp' => 'very much so'
);
Then you maintain consistency instead of relying on specific
characters. That makes more sense than trying to make shorthand for
something so basic to the language. I remember moving from Perl to PHP
I remember thinking "what the hell? Everything is a $, how do you make
hashes?"
Secondly,
"Second, we broke syntax highlighters, IDEs, and so forth when we
introduced namespaces"
Don't get me started on namespaces. :)