From: dw-bugs dot php dot net at botanicus dot net
Operating system: Linux
PHP version: 4.3.3
PHP Bug Type: Scripting Engine problem
Bug description: Access to supervariables via $$variable does not function as doented.

Description:
------------
From the implementation I suppose this is pretty obvious, but the
following does not work:

$data_source = '_POST';
$data =& $$data_source;

'$data' does not point at $_POST as expected. I'd consider this a problem
- your implementation is showing through. Either re-label $_POST, etc. as
not actually being superglobals, or fix the underlying implementation
(which does not at present match up with your doentation).

"""This is a 'superglobal', or automatic global, variable. This simply
means that it is available in all scopes throughout a script."""

This statement is not true, since the variable is only 'automatic global'
when referred to by name directly (and thus gets caught by your special
case code). It does not actually exist in every scope.

I beg you not to mark this as a doentation problem and change the docs
to mention this. Fix it! It's a horrible inconsistancy. This, along with a
million other sour points, is the reason why I absolutely detest my day
job at the minute. Come on guys! Do it for me!

Reproduce code:
---------------
$data_source = '_POST';
$data =& $$data_source;

echo gettype($data);

Expected result:
----------------
array

Actual result:
--------------
NULL

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