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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: steffen dot moeller at med dot uni-rostock dot de
New email:
PHP Version: OS:

 

 [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: Sat Apr 20 05:01:27 2024 UTC