Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since PHP 8.0 robo outputs silenced errors #1116

Open
MartinMystikJonas opened this issue Jul 8, 2022 · 0 comments
Open

Since PHP 8.0 robo outputs silenced errors #1116

MartinMystikJonas opened this issue Jul 8, 2022 · 0 comments

Comments

@MartinMystikJonas
Copy link

Steps to reproduce

Use robo to run code that uses erro silencing operator (@) to silence expected errors

Expected behavior

Silenced errors should not be shown

Actual behavior

Robo outputs silenced error because handleError returns false and error_get_last() inside shutdown handler then return silenced error.

System Configuration

This happens since PHP 8.0 because error_reporting() in error handler for silenced errors does not return 0 as before.

Prior to PHP 8.0.0, the [error_reporting()](https://www.php.net/manual/en/function.error-reporting.php) called inside the custom error handler always returned 0 if the error was suppressed by the @ operator. As of PHP 8.0.0, it returns the value E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE.

See https://www.php.net/manual/en/language.operators.errorcontrol.php

@MartinMystikJonas MartinMystikJonas changed the title SIcne PHP 8 robo outputs silenced errors Since PHP 8.0 robo outputs silenced errors Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant