Re: RFC: Short syntax for Arrays (redux)
| From: | Stas Malyshev | Date: | Tue, 31 May 2011 20:28:23 +0000 |
| Subject: | Re: RFC: Short syntax for Arrays (redux) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52575@lists.php.net to get a copy of this message | ||
Hi!
At risk of turning this into a longer-than-necessary discussion, I believe a new RFC is required at this point. Making [ and ] work as (T_ARRAY, '(') and (')'), respectively is no longer good enough, for the main reason you've pointed out: JSON is becoming ubiquitous; actual first-class JSON would be very valuable to me.It looks appealing, though if you think about security implications, I'm not sure it'd be actually as useful as one might think - i.e., you'd rarely want to eval() a JSON string, and absent that native JSON may not help you much. That aside, I think [] as array syntax is long overdue and would improve PHP readability and compatibility with other dynamic languages. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227