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.

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:

Actual result:

Edit bug report at [url][/url]
Try a CVS snapshot (php4): [url][/url]
Try a CVS snapshot (php5): [url][/url]
Fixed in CVS: [url][/url]
Fixed in release: [url][/url]
Need backtrace: [url][/url]
Try newer version: [url][/url]
Not developer issue: [url][/url]
Expected behavior: [url][/url]
Not enough info: [url][/url]
Submitted twice: [url][/url]
register_globals: [url][/url]
PHP 3 support discontinued: [url][/url]
Daylight Savings: [url][/url]
IIS Stability: [url][/url]
Install GNU Sed: [url][/url]
Floating point limitations: [url][/url]