php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67030 Support property syntax for associative arrays
Submitted: 2014-04-05 21:44 UTC Modified: 2014-04-06 06:28 UTC
From: olafvdspek at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.5.11 OS:
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: olafvdspek at gmail dot com
New email:
PHP Version: OS:

 

 [2014-04-05 21:44 UTC] olafvdspek at gmail dot com
Description:
------------
Could you support the property access syntax -> for associative arrays?
This would make the syntax slightly simpler and it'd save notices like: "Use of undefined constant name - assumed 'name' in /home/olaf/a.php on line 4"

Test script:
---------------
$v['name'] = 'Olaf';
echo $v->name;

Actual result:
--------------
Olaf

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-06 06:28 UTC] nikic@php.net
-Status: Open +Status: Wont fix
 [2014-04-06 06:28 UTC] nikic@php.net
Won't happen. offset != property, array != object.
 [2014-04-06 12:45 UTC] olafvdspek at gmail dot com
Would you mind being a little bit more constructive in your rejection?
'name' isn't an offset, I know array != object but I've no idea why you think this would be a bad idea.
 [2015-05-06 11:57 UTC] olafvdspek at gmail dot com
Somebody, please?
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 14:01:31 2025 UTC