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

PHP-Scoper crashes when E_DEPRECATED issues are triggered #1092

Open
sebastianbergmann opened this issue Dec 7, 2024 · 10 comments
Open

PHP-Scoper crashes when E_DEPRECATED issues are triggered #1092

sebastianbergmann opened this issue Dec 7, 2024 · 10 comments

Comments

@sebastianbergmann
Copy link
Contributor

See thecodingmachine/safe#442 (comment) for details.

@sebastianbergmann
Copy link
Contributor Author

Would it be possible to release a version that does not escalate E_DEPRECATED to a fatal error?

@theofidry
Copy link
Member

Thanks for the issue @sebastianbergmann, I started to work on it in #1090 if you want to follow this. But I admit I was keen to wait on a release of thecodingmachine/safe before proceeding due to the huge amount of warnings/deprecations/errors I am getting from it right now* (a few days ago). My understanding was this should happen fairly soon

@sebastianbergmann
Copy link
Contributor Author

sebastianbergmann commented Dec 7, 2024

I subscribed to #1090, thanks for pointing this out.

However and apart from the current issue with thecodingmachine/safe, I do not think that php-scoper should error out when an E_DEPRECATED is triggered. But that is up to you, of course.

Thank you for working on this!

@theofidry
Copy link
Member

I do not think that php-scoper should error out when an E_DEPRECATED is triggered

It is not ideal I agree, I wasn't really aware of that issue.

@staabm
Copy link

staabm commented Dec 16, 2024

fyi, I don't think we will see a thecodingmachine/safe release in the near future
(saying that as one of the maintainers)

@theofidry
Copy link
Member

@staabm is the state of the project that bad?

@sebastianbergmann
Copy link
Contributor Author

sebastianbergmann commented Jan 2, 2025

As showcased by sebastianbergmann/phpunit#6093, this has now become an even bigger problem for PHPUnit.

Please release a version of PHP-Scoper that does not crash when an E_DEPRECATED is triggered ASAP. Thank you!

@sebastianbergmann
Copy link
Contributor Author

As a workaround, I tried running php-scoper on PHP 8.4 with error_reporting=0 (sebastianbergmann/phpunit@be63bf5).

This way, php-scoper does not crash due to E_DEPRECATED issues. However, use PropertyHookType; in Generator.php is still transformed into use PHPUnitPHAR\PropertyHookType;.

@sebastianbergmann sebastianbergmann changed the title PHP-Scoper does not work on PHP 8.4 PHP-Scoper crashes when E_DEPRECATED issues are triggered Jan 2, 2025
@theofidry
Copy link
Member

This way, php-scoper does not crash due to E_DEPRECATED issues. However, use PropertyHookType; in Generator.php is still transformed into use PHPUnitPHAR\PropertyHookType;.

If it's urgent: you can add this type as an excluded symbol

I'll likely try the shish fork meanwhile or silence the deprecations

@sebastianbergmann
Copy link
Contributor Author

I'll likely try the shish fork meanwhile or silence the deprecations

The deprecations do not bother me as much as the outdated version of jetbrains/phpstorm-stubs that is bundled in the current release.

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

3 participants