diff options
-rw-r--r-- | Zend/tests/warning_during_heredoc_scan_ahead.phpt | 3 | ||||
-rw-r--r-- | Zend/zend_language_scanner.l | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Zend/tests/warning_during_heredoc_scan_ahead.phpt b/Zend/tests/warning_during_heredoc_scan_ahead.phpt index 099d1c087f..c252be1f4f 100644 --- a/Zend/tests/warning_during_heredoc_scan_ahead.phpt +++ b/Zend/tests/warning_during_heredoc_scan_ahead.phpt @@ -6,6 +6,7 @@ No warnings should be thrown during heredoc scan-ahead <<<TEST ${x} \400 +${"\400"} ${/*} TEST; @@ -15,6 +16,8 @@ Warning: Unexpected character in input: '' (ASCII=1) state=0 in %s on line %d Warning: Octal escape sequence overflow \400 is greater than \377 in %s on line %d +Warning: Octal escape sequence overflow \400 is greater than \377 in %s on line %d + Warning: Unterminated comment starting line %d in %s on line %d Parse error: syntax error, unexpected end of file in %s on line %d diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index db493211e2..3cb739330a 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1072,8 +1072,7 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot octal_buf[2] = *(++s); } } - if (octal_buf[2] && - (octal_buf[0] > '3')) { + if (octal_buf[2] && (octal_buf[0] > '3') && !SCNG(heredoc_scan_ahead)) { /* 3 octit values must not overflow 0xFF (\377) */ zend_error(E_COMPILE_WARNING, "Octal escape sequence overflow \\%s is greater than \\377", octal_buf); } |