Doc #75330 [Opn->Nab]: Incorrect word choice
| From: | peehaa@php.net | Date: | Sat, 07 Oct 2017 00:25:17 +0000 |
| Subject: | Doc #75330 [Opn->Nab]: Incorrect word choice | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15039@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75330&edit=1
ID: 75330
Updated by: peehaa@php.net
Reported by: danielklein at airpost dot net
Summary: Incorrect word choice
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug
Imo it's clear as it is as it's (T_STRING) in parentheses.
Previous Comments:
------------------------------------------------------------------------
[2017-10-07 00:09:33] danielklein at airpost dot net
I just realised it means "the last of all the tokens", not "the last T_STRING
token". I think it would be better as "the last T_STRING token" or "the second
T_STRING token".
------------------------------------------------------------------------
[2017-10-06 23:36:28] danielklein at airpost dot net
Description:
------------
---
From manual page: http://www.php.net/function.token-get-all
---
Example #3 token_get_all() on a class using a reserved word example
<?php
$source = <<<'code'
<?php
class A
{
const PUBLIC = 1;
}
code;
$tokens = token_get_all($source, TOKEN_PARSE);
foreach ($tokens as $token) {
if (is_array($token)) {
echo token_name($token[0]) , PHP_EOL;
}
}
?>
The above example will output something similar to:
T_OPEN_TAG
T_WHITESPACE
T_CLASS
T_WHITESPACE
T_STRING
T_CONST
T_WHITESPACE
T_STRING
T_LNUMBER
Without the TOKEN_PARSE flag, the *penultimate* token (T_STRING) would have been T_PUBLIC.
----
The word "penultimate" is incorrect here. "penultimate" means "second to
last", therefore it refers to "A", not "PUBLIC". While "ultimate"
is more accurate, the word "last" or "final" would be a better choice here.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75330&edit=1