mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Avoid duplicate octal warning during heredoc scan ahead
This commit is contained in:
commit
fc8cfb1b1a
2 changed files with 18 additions and 2 deletions
17
Zend/tests/warning_during_heredoc_scan_ahead.phpt
Normal file
17
Zend/tests/warning_during_heredoc_scan_ahead.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
No warnings should be thrown during heredoc scan-ahead
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
<<<TEST
|
||||
\400
|
||||
${"\400"}
|
||||
TEST;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
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: Undefined variable $ in %s on line %d
|
|
@ -1113,8 +1113,7 @@ static zend_result zend_scan_escape_string(zval *zendlval, char *str, int len, c
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue