Req #55493 [Com]: Superglobal variable variables with ${expression} in non-global scope
| From: | good821 at 126 dot com | Date: | Mon, 29 Aug 2011 08:26:51 +0000 |
| Subject: | Req #55493 [Com]: Superglobal variable variables with ${expression} in non-global scope | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163072@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55493&edit=1
ID: 55493
Comment by: good821 at 126 dot com
Reported by: vovan-ve at yandex dot ru
Summary: Superglobal variable variables with ${expression} in
non-global scope
Status: Assigned
Type: Feature/Change Request
Package: Variables related
Operating System: Windows XP SP3
PHP Version: 5.3.7
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
http://www.jetsjerseyonline.com/dwight-lowery-jersey-c-10_27.html Dwight
Lowery Jersey
http://www.jetsjerseyonline.com/joe-klecko-jersey-c-10_35.html Joe
Klecko Throwback jersey
http://www.jetsjerseyonline.com/joe-namath-jersey-c-10_18.html Joe
Namath Throwback Jersey
Previous Comments:
------------------------------------------------------------------------
[2011-08-26 23:09:57] johannes@php.net
Mind that even when when this special case is treated it still won't work with
get_defined_vars() and others. I think the current behavior can be documented in the clearest way
giving the least confusion ... so I would not implement it.
------------------------------------------------------------------------
[2011-08-24 14:34:30] vovan-ve at yandex dot ru
Programmers, who use variable variable, dooms themself to slowdown performance at any way due to
calculation of the expressions. They won't see the difference, I think.
------------------------------------------------------------------------
[2011-08-24 14:00:39] vovan-ve at yandex dot ru
But what about SUPERglobal? In fact they are almost superglobal :)
------------------------------------------------------------------------
[2011-08-24 13:54:34] laruence@php.net
+1 for dmitry
------------------------------------------------------------------------
[2011-08-24 13:04:22] dmitry@php.net
ZE decides if a variable have to be fetched from the global scope at compile time checking
predefined list of super-global variables.
The variable fetching by name (e.g. $$name) is always done from local scope.
Of course it's possible to extend executor to check for list of super-global variables at
run-time, but it'll introduce significant slowdown for each fetch by name. I really don't
like it.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=55493
--
Edit this bug report at https://bugs.php.net/bug.php?id=55493&edit=1