Req #62044 [Opn->Csd]: Short object syntax request

From: Date: Tue, 16 Dec 2014 23:24:49 +0000
Subject: Req #62044 [Opn->Csd]: Short object syntax request
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189090@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62044&edit=1 ID: 62044 Updated by: kalle@php.net Reported by: pravdin at vl dot ru Summary: Short object syntax request -Status: Open +Status: Closed Type: Feature/Change Request Package: Scripting Engine problem PHP Version: 5.4.3 -Assigned To: +Assigned To: kalle Block user comment: N Private report: N New Comment: Already tried to be voted in as an RFC a while back, but declined. Previous Comments: ------------------------------------------------------------------------ [2014-05-01 19:41:57] requinix@php.net Related To: Bug #67171 ------------------------------------------------------------------------ [2012-05-29 00:48:06] pravdin at vl dot ru > Why would you need to store plain key => value pairs as objects? In the same manner I can ask you why are you using arrays? Or, why are you using traits, or closures? Or, why are you using short arrays syntax? Because sometimes it is needed, and short syntax is easier and makes code more readable. In the past, we lived without closures and all program worked. And without short arrays syntax, and programs also worked :) So, this request is not a critical issue, but a step to make language more pretty and more convenient, whick makes development easier, quicker and more pleasant. ------------------------------------------------------------------------ [2012-05-28 15:12:39] shiranai7 at hotmail dot com Why would you need to store plain key => value pairs as objects? If you need extra functionality for your data, make use of your own or built-in classes. JavaScript has the object literal syntax because it distinguishses between an array - e.g. [1,2,3] - and an object literal - e.g. {name: 'Bob'}. PHP arrays can be used either way. This is why PHP has no such syntax. ------------------------------------------------------------------------ [2012-05-22 20:06:20] riptide dot tempora at opinehub dot com I wouldn't consider this the highest priority bug/request ever, but that would definitely be great. :D ------------------------------------------------------------------------ [2012-05-21 17:47:55] duke at ejoom dot com It will be nice to see this feature. We should have more friendly syntax. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=62044 -- Edit this bug report at https://bugs.php.net/bug.php?id=62044&edit=1

« previous php.bugs (#189090) next »