Commit cb1458f
committed
PHP 8.2 | Tokenizer/PHP: allow for true in union types
Previously, `false` and `null` were already allowed in union types. As of PHP 8.2, `true` has been added to the supported types in PHP and can also be used in union types.
Also see: https://3v4l.org/ZpfID
This commit adjusts the Tokenizer to correctly retokenize the `T_BITWISE_OR` character to `T_UNION_TYPE` when `true` is included in a union type.
Includes unit tests.
Refs:
* https://wiki.php.net/rfc/true-type1 parent 086d955 commit cb1458f
File tree
3 files changed
+13
-0
lines changed- src/Tokenizers
- tests/Core/Tokenizer
3 files changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2767 | 2767 | | |
2768 | 2768 | | |
2769 | 2769 | | |
| 2770 | + | |
2770 | 2771 | | |
2771 | 2772 | | |
2772 | 2773 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
132 | 141 | | |
133 | 142 | | |
134 | 143 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
| |||
0 commit comments