|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70586 When i try ${'_'.'POST'} i get: Notice: Undefined variable: _POST in
Submitted: 2015-09-25 20:46 UTC Modified: 2015-12-19 10:26 UTC
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: DAVIDhaker at yandex dot ru Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.6.14RC1 OS: Windows 10 Pro x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: DAVIDhaker at yandex dot ru
New email:
PHP Version: OS:


 [2015-09-25 20:46 UTC] DAVIDhaker at yandex dot ru
When i try ${'_'.'POST'} in object __call i get: Notice: Undefined variable: _POST in ...

Test script:
	class A {
		public function __call($method, $args){
			var_dump($_POST, ${'_POST'}, ${'_'.'POST'}, '_POST' == '_'.'POST', $_POST == ${'_POST'});
	$class = new A();

Expected result:
array(0) { } array(0) { } NULL bool(true) bool(true)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-19 04:14 UTC]
Looks like it's fixed in PHP 7:

Also seems to indeed be specific to `__call` within a class. I don't get this for just var_dump() at top-level.
 [2015-12-19 04:14 UTC]
-Status: Open +Status: Verified
 [2015-12-19 10:26 UTC]
-Status: Verified +Status: Not a bug
 [2015-12-19 10:26 UTC]
Accessing super globals through variable variables is undefined behavior. It may or may not work depending on whether the variable name is evaluated at compile-time or not.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 00:01:28 2024 UTC