Skip to content

Commit b233de0

Browse files
committed
Fix bug #61681: Malformed grammar
Generate T_STRING_VARNAME only if it actually is one. This is only the case for "${varname}" and "${varname[offset]}" so we can just add a check for } or [ after the LABEL.
1 parent 8ac56c1 commit b233de0

File tree

5 files changed

+247
-210
lines changed

5 files changed

+247
-210
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PHP NEWS
1010
- Core:
1111
. Implemented FR #60738 (Allow 'set_error_handler' to handle NULL).
1212
(Laruence, Nikita Popov)
13+
. Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).
1314

1415
- cURL:
1516
. Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,

Zend/tests/bug61681.phpt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Bug #61681: Malformed grammar
3+
--FILE--
4+
<?php
5+
$la = "ooxx";
6+
7+
echo "${substr('laruence', 0, 2)}";
8+
9+
?>
10+
--EXPECT--
11+
ooxx

0 commit comments

Comments
 (0)