php.net |  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: 2018-04-08 17:23 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: gwenael dot chailleu at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 7.0.8 OS:
Private report: No CVE-ID: None
 [2016-06-27 08:24 UTC] gwenael dot chailleu at gmail dot com
Description:
------------
Hello,

I can read in http://php.net/manual/fr/migration70.incompatible.php 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 !


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-27 09:43 UTC] cmb@php.net
-Assigned To: +Assigned To: aharvey
 [2016-06-27 09:43 UTC] cmb@php.net
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 <https://3v4l.org/fvtGd>. I'm assigning to Adam who
made the relevant commit (r337333). Can you please clarify, Adam?

[1] <http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.variable-handling.global>
[2] <https://wiki.php.net/rfc/uniform_variable_syntax>
 [2017-10-24 07:18 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: aharvey +Assigned To:
 [2018-04-08 17:23 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=344640
Log: Fix #72500: Imprecision about compatibility of &quot;Variable variables and global&quot;
 [2018-04-08 17:23 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-04-08 17:23 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=35511ebc54edd56f1653a6a956210b4728570316
Log: Fix #72500: Imprecision about compatibility of &quot;Variable variables and global&quot;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC