ID: 26047
Updated by: [email]andiphp.net[/email]
Reported By: dw-bugs dot php dot net at botanicus dot net
-Status: Open
+Status: Wont fix
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.3.3
New Comment:

Hi,

This is by-design and it's the price you have to pay for these special
superglobals. A price which is worth paying...
If this is not doented in the online docs then feel free to drop a
line to [email]phpdoclists.php.net[/email] with the wording you think should be added


Previous Comments:
------------------------------------------------------------------------

[2003-10-30 23:38:43] dw-bugs dot php dot net at botanicus dot net

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 this bug report at [url]http://bugs.php.net/?id=26047&edit=1[/url]