php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64186 Curly brace syntax not accessing superglobals?
Submitted: 2013-02-11 00:22 UTC Modified: 2013-02-13 14:43 UTC
From: michal at durooil dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.4.11 OS: Windows 7 x64
Private report: No CVE-ID: None
 [2013-02-11 00:22 UTC] michal at durooil dot com
Description:
------------
This looks really weird to me.

Test script:
---------------
// works well
print_r(${'_GET'});

// this not however
// returns notice: "Undefined variable: _GET"
$name = '_GET';
print_r(${$name});


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-13 14:43 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2013-02-13 14:43 UTC] 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

This is to to just-in-time initialization of super globals. You either neet a direct call to that same super global in the same function or have to disable this optimization by setting auto_globals_jit in php.ini
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 11:01:33 2025 UTC