mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Merge branch 'PHP-8.0'
* PHP-8.0: Report parse errors during preloading
This commit is contained in:
commit
d0a07cd0fa
3 changed files with 22 additions and 0 deletions
|
@ -4480,6 +4480,10 @@ static int accel_preload(const char *config, zend_bool in_child)
|
||||||
destroy_op_array(op_array);
|
destroy_op_array(op_array);
|
||||||
efree_size(op_array, sizeof(zend_op_array));
|
efree_size(op_array, sizeof(zend_op_array));
|
||||||
} else {
|
} else {
|
||||||
|
if (EG(exception)) {
|
||||||
|
zend_exception_error(EG(exception), E_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
CG(unclean_shutdown) = 1;
|
CG(unclean_shutdown) = 1;
|
||||||
ret = FAILURE;
|
ret = FAILURE;
|
||||||
}
|
}
|
||||||
|
|
2
ext/opcache/tests/preload_parse_error.inc
Normal file
2
ext/opcache/tests/preload_parse_error.inc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?php
|
||||||
|
parse error
|
16
ext/opcache/tests/preload_parse_error.phpt
Normal file
16
ext/opcache/tests/preload_parse_error.phpt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--TEST--
|
||||||
|
Parse error in preload script
|
||||||
|
--INI--
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
opcache.optimization_level=-1
|
||||||
|
opcache.preload={PWD}/preload_parse_error.inc
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
require_once('skipif.inc');
|
||||||
|
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
OK
|
||||||
|
--EXPECTF--
|
||||||
|
Parse error: syntax error, unexpected identifier "error" in %s on line %d
|
Loading…
Add table
Add a link
Reference in a new issue