|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: yky at yky dot pw
New email:
PHP Version: OS:


 [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: Wed Oct 20 15:03:33 2021 UTC