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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 + 5 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 00:01:32 2024 UTC