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 
documented.

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 documentation).

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

Reply via email to