|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72500 Imprecision about compatibility of "Variable variables and global"
Submitted: 2016-06-27 08:24 UTC Modified: 2017-10-24 07:18 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: gwenael dot chailleu at gmail dot com Assigned:
Status: Open Package: Documentation problem
PHP Version: 7.0.8 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-06-27 08:24 UTC] gwenael dot chailleu at gmail dot com

I can read in that "Variable variables can no longer be used with the global keyword. ". In my interpretation of this warning "global $$var;" is no longer a valid syntax and must be replaced by "global ${$var};" . But, obviously, "global $$var;" it still accepted (only tested in php 7.0.4). Is this particular syntax planned to be removed ? The code example given (global $$foo->bar;) should rather illustrate the new left-to right evaluation order of the expressions including variable variables syntax.

Thanks for your answer !


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-27 09:43 UTC]
-Assigned To: +Assigned To: aharvey
 [2016-06-27 09:43 UTC]
I agree that this section[1] is not clear enough, and that the
example is indeed more related to the new uniform variable
syntax[2]. At least variable variables appear to work fine with
global, see <>. I'm assigning to Adam who
made the relevant commit (r337333). Can you please clarify, Adam?

[1] <>
[2] <>
 [2017-10-24 07:18 UTC]
-Status: Assigned +Status: Open -Assigned To: aharvey +Assigned To:
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC