Doc #72500 [Asn->Opn]: Imprecision about compatibility of "Variable variables and global"
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 07:18:07 +0000 |
| Subject: | Doc #72500 [Asn->Opn]: Imprecision about compatibility of "Variable variables and global" | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15147@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72500&edit=1
ID: 72500
Updated by: kalle@php.net
Reported by: gwenael dot chailleu at gmail dot com
Summary: Imprecision about compatibility of "Variable
variables and global"
-Status: Assigned
+Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: 7.0.8
-Assigned To: aharvey
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2016-06-27 09:43:51] 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>
------------------------------------------------------------------------
[2016-06-27 08:24:27] 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 !
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72500&edit=1