|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29068 ambiguity of $$arrayref[0] []operator too strong
Submitted: 2004-07-09 01:01 UTC Modified: 2004-07-09 02:43 UTC
From: steffen dot moeller at med dot uni-rostock dot de Assigned:
Status: Not a bug Package: Arrays related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2004-07-09 01:01 UTC] steffen dot moeller at med dot uni-rostock dot de
$$c is an array 
$$c[0] is not defined 
($$c)[0] is a syntax error 
There seems not way to directly access the content of a 
referenced array. 
My PHP version is 4.3.4-4 of Debian unstable 

Reproduce code:
$tmp=array("hello world");
$a=$$c; # works
echo $a[0]; # works
echo ($$c)[0]; # should work
echo {$$c}[0]; # would not mind if this was an alternative

Expected result:

Actual result:
syntax error 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 24 12:03:37 2021 UTC