From: Nikita Popov Date: Thu, 14 May 2020 10:54:20 +0000 (+0200) Subject: Canonicalize bison error during ini parsing X-Git-Tag: php-7.4.7RC1~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3978d3a957d721bdaaa77b604486e200897c90a4;p=php Canonicalize bison error during ini parsing Bison 3.6 seems to use "end of file" rather than "$end" for this. Force the same on older bison versions to be consistent. --- diff --git a/Zend/tests/bug70748.phpt b/Zend/tests/bug70748.phpt index feb0e2a59d..d6703487ce 100644 --- a/Zend/tests/bug70748.phpt +++ b/Zend/tests/bug70748.phpt @@ -15,6 +15,6 @@ var_dump(parse_ini_file($ini_file)); unlink(__DIR__ . "/bug70748.ini"); ?> --EXPECTF-- -Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d +Warning: syntax error, unexpected end of file, expecting '}' in %sbug70748.ini on line %d in %sbug70748.php on line %d bool(false) diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 749f929a9b..db9b7d670b 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -292,6 +292,7 @@ static void zval_ini_dtor(zval *zv) %define api.pure full %define parse.error verbose +%token END 0 "end of file" %token TC_SECTION %token TC_RAW %token TC_CONSTANT diff --git a/ext/standard/tests/general_functions/parse_ini_string_error.phpt b/ext/standard/tests/general_functions/parse_ini_string_error.phpt index 0eba65ea17..afa291d31f 100644 --- a/ext/standard/tests/general_functions/parse_ini_string_error.phpt +++ b/ext/standard/tests/general_functions/parse_ini_string_error.phpt @@ -5,6 +5,6 @@ Ini parsing errors should not result in memory leaks var_dump(parse_ini_string('a="b')); ?> --EXPECTF-- -Warning: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in Unknown on line 1 +Warning: syntax error, unexpected end of file, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in Unknown on line 1 in %s on line %d bool(false)