Doc #74049 [Com]: Unclear statement about vital difference between versions

From: Date: Wed, 01 Mar 2017 09:08:45 +0000
Subject: Doc #74049 [Com]: Unclear statement about vital difference between versions
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14468@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
 Comment by:         peehaa@php.net
 Reported by:        teo8976 at gmail dot com
 Summary:            Unclear statement about vital difference between
                     versions
 Status:             Open
 Type:               Documentation Problem
 Package:            Scripting Engine problem
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

IMO OP just confused himself here.

May not in this context is just fine.

Sounds like OP is thinking about https://www.ietf.org/rfc/rfc2119.txt which our
manual does not follow.

> That's confusing, as "may not" usually means "may or may not"

No it usually does not. It means "may not".

I don't feel strongly either way to change or keep the wording if it really is confusing to
people, but I wonder if it's just OP or also other people *and* whether it means it's also
confusing in other places in the manual.


Previous Comments:
------------------------------------------------------------------------
[2017-02-06 14:24:59] cmb@php.net

> You don't know what "may not" means?

Wouldn't "must not" be clearer, anyway?

------------------------------------------------------------------------
[2017-02-05 20:32:21] teo8976 at gmail dot com

By the way, it says "from PHP 7.1", but $this is not allowed in 5.x either

------------------------------------------------------------------------
[2017-02-05 20:29:25] teo8976 at gmail dot com

Oh, I see, "may not" as in "are not allowed to".

That's confusing, as "may not" usually means "may or may not", as in
"you don't know whether they do or they don't".


It should read "cannot include", then.

------------------------------------------------------------------------
[2017-02-05 20:18:30] requinix@php.net

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.

------------------------------------------------------------------------
[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


Thread (8 messages)

« previous php.doc.bugs (#14468) next »