Edit report at https://bugs.php.net/bug.php?id=60408&edit=1
ID: 60408
User updated by: bugzilla33 at gmail dot com
Reported by: bugzilla33 at gmail dot com
-Summary: Array element access on instantiation (same like
class member in 5.4RC)
+Summary: Array/String element access on instantiation (same
like class member in 5.4RC)
Status: Open
Type: Feature/Change Request
Package: Scripting Engine problem
PHP Version: 5.4.0RC2
Block user comment: N
Private report: N
New Comment:
/Summary change/ Array -> Array/String
Previous Comments:
------------------------------------------------------------------------
[2011-11-30 07:36:07] [email protected]
support (of course).
yes, but it need to be disscussd first ;)
------------------------------------------------------------------------
[2011-11-30 07:29:12] bugzilla33 at gmail dot com
>> echo array(1, 2, 3)[0]; //output 1
>> echo "foobar"[2]; //output o
>> echo "foobar"["foo"][0] // output f
>> works.
Excellent! Have you tested it with short array constructor?
echo [1, 2, 3][0]; //output 1
Are there any opportunities to make it public in the final PHP 5.4?
------------------------------------------------------------------------
[2011-11-30 06:04:19] [email protected]
see https://wiki.php.net/rfc/constdereference
------------------------------------------------------------------------
[2011-11-29 14:42:50] bugzilla33 at gmail dot com
(edit summary)
------------------------------------------------------------------------
[2011-11-29 14:40:01] bugzilla33 at gmail dot com
20 Jun 2011, PHP 5.4.0 Alpha 1 -> Added array dereferencing support. (Felipe)
11 Nov 2011, PHP 5.4.0 RC1 -> Added class member access on instantiation (e.g.
(new foo)->bar()) support. (Felipe)
Many thanks for Felipe.
It would be nice to add: Array element access on instantiation
array()[$x] and [][$x]
Then everything would be fully useful, but not in part.
------------------------------------------------------------------------
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=60408
--
Edit this bug report at https://bugs.php.net/bug.php?id=60408&edit=1