mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
Merge branch 'PHP-7.1' into PHP-7.2
This commit is contained in:
@@ -5,6 +5,8 @@ PHP NEWS
|
||||
- Core
|
||||
. Fixed bug #74878 (Data race in ZTS builds). (Nikita, Dmitry)
|
||||
. Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
|
||||
. Fixed bug #75252 (Incorrect token formatting on two parse errors in one
|
||||
request). (Nikita)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #75212 (php_value acts like php_admin_value). (Remi)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #75252: Incorrect token formatting on two parse errors in one request
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$code = <<<'CODE'
|
||||
function test_missing_semicolon() : string {
|
||||
$x = []
|
||||
FOO
|
||||
}
|
||||
CODE;
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
@@ -947,6 +947,8 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
|
||||
/* this should be compatible with the standard zenderror */
|
||||
ZEND_COLD void zenderror(const char *error) /* {{{ */
|
||||
{
|
||||
CG(parse_error) = 0;
|
||||
|
||||
if (EG(exception)) {
|
||||
/* An exception was thrown in the lexer, don't throw another in the parser. */
|
||||
return;
|
||||
|
||||
+1
-3
@@ -1242,9 +1242,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
|
||||
sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
|
||||
}
|
||||
/* the parser would return 1 (failure), we can bail out nicely */
|
||||
if (type == E_PARSE) {
|
||||
CG(parse_error) = 0;
|
||||
} else {
|
||||
if (type != E_PARSE) {
|
||||
/* restore memory limit */
|
||||
zend_set_memory_limit(PG(memory_limit));
|
||||
efree(buffer);
|
||||
|
||||
Reference in New Issue
Block a user