|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-02-05 19:00 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
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.