php.net |  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
Description:
------------
$$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");
$c="tmp";
$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:
----------------
"tmp" 

Actual result:
--------------
syntax error 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 06:01:24 2019 UTC