From:             steffen dot moeller at med dot uni-rostock dot de
Operating system: Linux
PHP version:      Irrelevant
PHP Bug Type:     Arrays related
Bug description:  ambiguity of $$arrayref[0] []operator too strong

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 

-- 
Edit bug report at http://bugs.php.net/?id=29068&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29068&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29068&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29068&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29068&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29068&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29068&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29068&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29068&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29068&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29068&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29068&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29068&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29068&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29068&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29068&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29068&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29068&r=float

Reply via email to