|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66223 Undefined variable: _GET
Submitted: 2013-12-03 06:30 UTC Modified: 2013-12-03 17:53 UTC
From: yky at yky dot pw Assigned:
Status: Duplicate Package: Testing related
PHP Version: 5.4.22 OS: windows7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
13 - 4 = ?
Subscribe to this entry?

 [2013-12-03 06:30 UTC] yky at yky dot pw
In Class can't indirect use $_GET、$_POST etc;

Test script:
$_GET['yk'] = 'aabb';
$get = '_GET';
$tmp = $$get;
echo $tmp['yk'];     //right

class yk{
	public function get(){
		$get = '_GET';
		$tmp = $$get;
		echo $tmp['yk'];
	public function get2(){
		$get = 'Atmp';
		$Atmp = 'bbaa';
		$tmp = $$get;
		echo $tmp;

$yk = new yk();
$yk->get();   //error  Undefined variable: _GET


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-03 17:53 UTC]
-Status: Open +Status: Duplicate
 [2013-12-03 17:53 UTC]
Duplicate of This behavior is classified Won't Fix and documented with the last note on
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 21 13:03:33 2021 UTC