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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 03:01:29 2024 UTC