Doc #74049 [Opn->Fbk]: Unclear statement about vital difference between versions
| From: | requinix@php.net | Date: | Sun, 05 Feb 2017 20:18:30 +0000 |
| Subject: | Doc #74049 [Opn->Fbk]: Unclear statement about vital difference between versions | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14413@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74049&edit=1
ID: 74049
Updated by: requinix@php.net
Reported by: teo8976 at gmail dot com
Summary: Unclear statement about vital difference between
versions
-Status: Open
+Status: Feedback
Type: Documentation Problem
-Package: Documentation problem
+Package: Scripting Engine problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I'm not sure I understand what the problem is. You don't know what "may not"
means?
It means these three examples
function() use($_GET) { } - https://3v4l.org/hqpiD
function() use($this) { } - https://3v4l.org/6Ten8
function($foo) use($foo) { } - https://3v4l.org/LiPQ4
are not allowed.
Previous Comments:
------------------------------------------------------------------------
[2017-02-05 19:00:49] teo8976 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/functions.anonymous
---
Regarding the "use" language construct:
"Closures may also inherit variables from the parent scope. Any such variables must be passed
to the use language construct. From PHP 7.1, these variables MAY NOT INCLUDE superglobals, $this, or
variables with the same name as a parameter"
(emphasys added)
What the heck does "MAY NOT" mean?? Either they include or they don't, or they do in
some cases, in which case the docs MUST specify which ones are included and which one are not, in
what cases and depending on what.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74049&edit=1