mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Deprecate the parameter of get_defined_functions() (#19425)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions
This commit is contained in:
parent
f64c6248b5
commit
94a15cc92f
3 changed files with 6 additions and 20 deletions
|
@ -1,16 +0,0 @@
|
||||||
--TEST--
|
|
||||||
Bug #79668 (get_defined_functions(true) may miss functions)
|
|
||||||
--INI--
|
|
||||||
disable_functions=sha1_file,password_hash
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
$df = get_defined_functions(true);
|
|
||||||
foreach (['sha1', 'sha1_file', 'hash', 'password_hash'] as $funcname) {
|
|
||||||
var_dump(in_array($funcname, $df['internal'], true));
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
--EXPECT--
|
|
||||||
bool(true)
|
|
||||||
bool(false)
|
|
||||||
bool(true)
|
|
||||||
bool(false)
|
|
|
@ -1483,15 +1483,15 @@ ZEND_FUNCTION(get_defined_functions)
|
||||||
zval internal, user;
|
zval internal, user;
|
||||||
zend_string *key;
|
zend_string *key;
|
||||||
zend_function *func;
|
zend_function *func;
|
||||||
bool exclude_disabled = 1;
|
bool exclude_disabled = true;
|
||||||
|
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &exclude_disabled) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &exclude_disabled) == FAILURE) {
|
||||||
RETURN_THROWS();
|
RETURN_THROWS();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exclude_disabled == 0) {
|
if (ZEND_NUM_ARGS() == 1) {
|
||||||
zend_error(E_DEPRECATED,
|
zend_error(E_DEPRECATED,
|
||||||
"get_defined_functions(): Setting $exclude_disabled to false has no effect");
|
"get_defined_functions(): The $exclude_disabled parameter has no effect since PHP 8.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
array_init(&internal);
|
array_init(&internal);
|
||||||
|
|
|
@ -22,6 +22,8 @@ var_dump(in_array($disabled_function, $functions['internal']));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Deprecated: get_defined_functions(): Setting $exclude_disabled to false has no effect in %s on line %d
|
Deprecated: get_defined_functions(): The $exclude_disabled parameter has no effect since PHP 8.0 in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
|
Deprecated: get_defined_functions(): The $exclude_disabled parameter has no effect since PHP 8.0 in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue