#34698 [Bgs]: bug with superglobal variables by name

From: Date: Sat, 01 Oct 2005 10:07:33 +0000
Subject: #34698 [Bgs]: bug with superglobal variables by name
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85841@lists.php.net to get a copy of this message
 ID:               34698
 User updated by:  andrius dot steponavicius at gmail dot com
 Reported By:      andrius dot steponavicius at gmail dot com
 Status:           Bogus
 Bug Type:         *General Issues
 Operating System: win32
 PHP Version:      4.4.0
 New Comment:

so.......

if this is NOT a BUG, then what is it ?..

what's wrong with my example code and HOW must I rewrote that stuff to
make it work ? WHY I can access superglobal by writing direct name, by
I can't using variable ?


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

[2005-10-01 11:40:26] johannes@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

. 

------------------------------------------------------------------------

[2005-10-01 11:33:44] andrius dot steponavicius at gmail dot com

Description:
------------
There is a bug while accessing superglobal variables by they names
inside functions or methods...

Reproduce code:
---------------
function test()
{
    var_dump($_REQUEST);
    var_dump(${'_REQUEST'});
    $temp = '_REQUEST';
    var_dump(${$temp});
}

test();

Expected result:
----------------
array(...){...}
array(...){...}
array(...){...}

Actual result:
--------------
array(...){...}
array(...){...}
Notice: Undefined variable:  _REQUEST in ...
null


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34698&edit=1


Thread (5 messages)

« previous php.bugs (#85841) next »