Skip to content

PHP 8.0 Compatibility #361

@giddie

Description

@giddie

There seem to be multiple fixes required for compatibility with PHP 8.0.3. It starts with:

2021/04/08 21:58:36 [error] 984#984: *21 FastCGI sent in stderr: "PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break" in /usr/share/webapps/ganglia/functions.php on line 732PHP message: PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function ganglia_api_error_handler(), 4 passed and exactly 5 expected in /usr/share/webapps/ganglia/lib/common_api.php:18
Stack trace:
#0 /usr/share/webapps/ganglia/ganglia.php(353): ganglia_api_error_handler()
#1 /usr/share/webapps/ganglia/get_ganglia.php(11): Gmetad()
#2 /usr/share/webapps/ganglia/index.php(7): include_once('...')
#3 {main}

It seems the fifth argument to set_error_handler() was deprecated a while back, and is now removed in PHP 8. After that:

2021/04/08 21:57:19 [error] 984#984: *19 FastCGI sent in stderr: "PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break" in /usr/share/webapps/ganglia/functions.php on line 732PHP message: PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /usr/share/webapps/ganglia/ganglia.php:353
Stack trace:
#0 /usr/share/webapps/ganglia/ganglia.php(353): in_array()
#1 /usr/share/webapps/ganglia/get_ganglia.php(11): Gmetad()
#2 /usr/share/webapps/ganglia/index.php(7): include_once('...')
#3 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions