mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Add note about inconsistent T_* constant values across PHP versions (thanks anonymous 11741)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@318883 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7253585e65
commit
2ae783e6b5
1 changed files with 18 additions and 0 deletions
|
@ -13,6 +13,24 @@
|
|||
know that, here is a table with those identifiers, PHP-syntax and
|
||||
references to the appropriate places in the manual.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Usage of T_* constants</title>
|
||||
<para>
|
||||
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 <constant>T_FILE</constant> constant is
|
||||
<literal>365</literal> in PHP 5.3, while the same value refers now to
|
||||
<constant>T_TRAIT</constant> in PHP 5.4 and the value of <constant>T_FILE</constant>
|
||||
is <literal>369</literal>. 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 <literal>10000</literal>) and an appropriate strategy that
|
||||
will work with both PHP versions and T_* values.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<table>
|
||||
<title>Tokens</title>
|
||||
<tgroup cols="3">
|
||||
|
|
Loading…
Reference in a new issue