get_defined_functions() Doesn’t Exclude Diabled Functions Anymore

get_defined_functions() used to have one parameter, called $exclude_disabled. It used to exclude functions appearing under the directive disabled_functions.

Since PHP 8.0, this parameter is not used anymore. It emits a warning since PHP 8.5.

PHP code

<?php

print_r(get_defined_functions(true));

?>

Before

Array
(
    [internal] => Array
        (
            [0] => exit
            [1] => die
            [2] => zend_version
            // many more functions
        )

    [user] => Array
        (
        )

)

After

PHP Deprecated:  get_defined_functions(): The $exclude_disabled parameter has no effect since PHP 8.0 in /codes/get_defined_functions.php on line 3

Deprecated: get_defined_functions(): The $exclude_disabled parameter has no effect since PHP 8.0 in /codes/get_defined_functions.php on line 3
Array
(
    [internal] => Array
        (
            [0] => clone
            [1] => exit
            [2] => die
            [3] => zend_version
            // many more functions
        )

    [user] => Array
        (
        )

)

PHP version change

This behavior changed in 8.5