File tree 3 files changed +34
-1
lines changed
3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ PHP NEWS
2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? ????, PHP 8.1.0beta3
4
4
5
+ - Core:
6
+ . Fixed bug #81342 (New ampersand token parsing depends on new line after it).
7
+ (Nikita)
8
+
5
9
- Date:
6
10
. Fixed bug #79580 (date_create_from_format misses leap year). (Derick)
7
11
. Fixed bug #80963 (DateTimeZone::getTransitions() truncated). (Derick)
Original file line number Diff line number Diff line change @@ -1858,7 +1858,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
1858
1858
RETURN_TOKEN (T_SR);
1859
1859
}
1860
1860
1861
- <ST_IN_SCRIPTING>" &" {TABS_AND_SPACES} (" $" |" ..." ) {
1861
+ <ST_IN_SCRIPTING>" &" [ \t\r\n]* (" $" |" ..." ) {
1862
1862
yyless (1 );
1863
1863
RETURN_TOKEN (T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG);
1864
1864
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #81342: New ampersand token parsing depends on new line after it
3
+ --FILE--
4
+ <?php
5
+
6
+ $ tokens = PhpToken::tokenize ('<?php $x & $x; $x &
7
+ $baz;
8
+ ' );
9
+ foreach ($ tokens as $ token ) {
10
+ echo $ token ->getTokenName (), "\n" ;
11
+ }
12
+
13
+ ?>
14
+ --EXPECT--
15
+ T_OPEN_TAG
16
+ T_VARIABLE
17
+ T_WHITESPACE
18
+ T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
19
+ T_WHITESPACE
20
+ T_VARIABLE
21
+ ;
22
+ T_WHITESPACE
23
+ T_VARIABLE
24
+ T_WHITESPACE
25
+ T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
26
+ T_WHITESPACE
27
+ T_VARIABLE
28
+ ;
29
+ T_WHITESPACE
You can’t perform that action at this time.
0 commit comments