mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Skip special function optimization for redeclared disabled functions
As pointed out on GH-5817.
This commit is contained in:
parent
f1a343439d
commit
2af1d36bc5
2 changed files with 8 additions and 4 deletions
|
@ -6,13 +6,11 @@ disable_functions=strlen
|
|||
<?php
|
||||
|
||||
function strlen(string $x): int {
|
||||
$len = 0;
|
||||
while (isset($x[$len])) $len++;
|
||||
return $len;
|
||||
return 42;
|
||||
}
|
||||
|
||||
var_dump(strlen("foobar"));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(6)
|
||||
int(42)
|
||||
|
|
|
@ -3954,6 +3954,12 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
|
|||
return FAILURE;
|
||||
}
|
||||
|
||||
if (fbc->type != ZEND_INTERNAL_FUNCTION) {
|
||||
/* If the function is part of disabled_functions, it may be redeclared as a userland
|
||||
* function with a different implementation. Don't use the VM builtin in that case. */
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (zend_args_contain_unpack(args)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue