Doc #80772 [NEW]: Documentation pages for tokenizer conflict with each other
| From: | edg at greenberg dot org | Date: | Thu, 18 Feb 2021 16:58:50 +0000 |
| Subject: | Doc #80772 [NEW]: Documentation pages for tokenizer conflict with each other | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-18567@lists.php.net to get a copy of this message | ||
From: edg at greenberg dot org
Operating system: n/a
PHP version: 7.4.15
Package: Unknown/Other Function
Bug Type: Documentation Problem
Bug description:Documentation pages for tokenizer conflict with each other
Description:
------------
---
From manual page: https://php.net/tokenizer.examples
---
The example code conflicts (does exactly the wrong thing) with the
warning on documentation page: https://www.php.net/manual/en/tokens.php
wherein it is written:
Note: Usage of T_* constants
All tokens listed below are also defined as PHP constants. Their value
is automatically generated based on PHP's underlying parser
infrastructure. This means that the concrete value of a token may change
between two PHP versions. For example the T_FILE constant is 365 in PHP
5.3, while the same value refers now to T_TRAIT in PHP 5.4 and the value
of T_FILE is 369. This means that your code should never rely directly
on the original T_* values taken from PHP version X.Y.Z, to provide some
compatibility across multiple PHP versions. Instead your code should
utilize custom values (using big numbers like 10000) and an appropriate
strategy that will work with both PHP versions and T_* values.
--
Edit bug report at https://bugs.php.net/bug.php?id=80772&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80772&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80772&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80772&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80772&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80772&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80772&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80772&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80772&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80772&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80772&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80772&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80772&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80772&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80772&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80772&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80772&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80772&r=mysqlcfg