Permalink
Browse files

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.
  • Loading branch information...
1 parent 8ac56c1 commit b233de098daceb145b9a5009b8861ebb9df5c961 @nikic nikic committed Apr 9, 2012
Showing with 247 additions and 210 deletions.
  1. +1 −0 NEWS
  2. +11 −0 Zend/tests/bug61681.phpt
  3. +232 −208 Zend/zend_language_scanner.c
  4. +2 −1 Zend/zend_language_scanner.l
  5. +1 −1 Zend/zend_language_scanner_defs.h
View
1 NEWS
@@ -10,6 +10,7 @@ PHP NEWS
- Core:
. Implemented FR #60738 (Allow 'set_error_handler' to handle NULL).
(Laruence, Nikita Popov)
+ . Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).
- cURL:
. Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
View
@@ -0,0 +1,11 @@
+--TEST--
+Bug #61681: Malformed grammar
+--FILE--
+<?php
+$la = "ooxx";
+
+echo "${substr('laruence', 0, 2)}";
+
+?>
+--EXPECT--
+ooxx
Oops, something went wrong.

0 comments on commit b233de0

Please sign in to comment.