Skip to content

Commit 3107088

Browse files
committed
Fix #78441: Parse error due to heredoc identifier followed by digit
Since digits are allowed for identifiers, we have to cater to them as well.
1 parent 08aafbe commit 3107088

File tree

5 files changed

+384
-356
lines changed

5 files changed

+384
-356
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ PHP NEWS
66
. Fixed bug #78220 (Can't access OneDrive folder). (cmb, ab)
77
. Fixed bug #77922 (Double release of doc comment on inherited shadow
88
property). (Nikita)
9+
. Fixed bug #78441 (Parse error due to heredoc identifier followed by digit).
10+
(cmb)
911

1012
- Intl:
1113
. Ensure IDNA2003 rules are used with idn_to_ascii() and idn_to_utf8()

Zend/tests/grammar/bug78441.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #78441 (Parse error due to heredoc identifier followed by digit)
3+
--FILE--
4+
<?php
5+
echo <<<FOO
6+
FOO4
7+
FOO, PHP_EOL;
8+
9+
echo <<<FOO
10+
bar
11+
FOO4
12+
FOO, PHP_EOL;
13+
14+
echo <<<'FOO'
15+
bar
16+
FOO4
17+
FOO, PHP_EOL;
18+
?>
19+
--EXPECT--
20+
FOO4
21+
bar
22+
FOO4
23+
bar
24+
FOO4

0 commit comments

Comments
 (0)