php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #48266 shorthand for array keryword
Submitted: 2009-05-13 19:57 UTC Modified: 2009-05-13 22:26 UTC
From: zyss at mail dot zp dot ua Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.9 OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zyss at mail dot zp dot ua
New email:
PHP Version: OS:

 

 [2009-05-13 19:57 UTC] zyss at mail dot zp dot ua
Description:
------------
One of the most frequently used keywords in PHP is "array".
It would be great to adopt just another construct from C/C++, namely array constructor using curly brackets { }.
These are cases when PHP code is oversaturated with "array" word.
In this way it would be much easier to write and read PHP code.

I am aware of case #3928 and http://wiki.php.net/rfc/shortsyntaxforarrays, but I think that curly brackets would be more suitable than square brackets.

Noone seems to complain of how C/C++ arrays are constructed.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-13 22:26 UTC] johannes@php.net
{} would create simpler lead to conflicts for the parser, but semantics will be discussed when this feature will be discussed the next time.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 17:01:35 2025 UTC