Skip to content

[BUG]: Phalcon\Support\Debug::onUncaughtLowSeverity() causes argument mismatch in PHP8. #16686

Description

@nakai-ps

Hello, I am using Phalcon 5.8 and PHP 8.3.

When I tried testing the debug functionality as follows:

    (new \Phalcon\Support\Debug())->listenLowSeverity();
    $x = $y; // $y is an undefined variable.

The following error occurred:

    ArgumentCountError: Phalcon\Support\Debug::onUncaughtLowSeverity() expects exactly 5 arguments, 4 given

Upon reviewing the source code, it shows that onUncaughtLowSeverity() requires 5 arguments.
https://github.com/phalcon/cphalcon/blob/v5.8.0/phalcon/Support/Debug.zep#L265C1-L265C90

Additionally, onUncaughtLowSeverity() is set within listenLowSeverity() by set_error_handler().
https://github.com/phalcon/cphalcon/blob/v5.8.0/phalcon/Support/Debug.zep#L206C1-L210C11

However, according to the documentation for set_error_handler(),
the 5th argument "errcontext" passed to the callback function was removed in PHP 8.0.0.
https://www.php.net/manual/en/function.set-error-handler.php

In other words, there seems to be an argument mismatch between set_error_handler() and onUncaughtLowSeverity().
Could you please address this issue?

Thank you for your consideration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    5.0The issues we want to solve in the 5.0 releasebugA bug reportstatus: mediumMedium

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions