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

One more incompatibility of bootstrap80.php with PHP <8.0 #332

Closed
dkop opened this issue Feb 10, 2021 · 3 comments
Closed

One more incompatibility of bootstrap80.php with PHP <8.0 #332

dkop opened this issue Feb 10, 2021 · 3 comments

Comments

@dkop
Copy link

dkop commented Feb 10, 2021

We are using Laravel Opcache in our project https://github.com/appstract/laravel-opcache
Configuration for this package supports excluding only directories from reading and caching https://github.com/appstract/laravel-opcache/blob/master/src/OpcacheClass.php#L62
So opcache:compile command tries to read and cache all *.php in our vendor directory, including bootstrap80.php files in polyfill packages. And it can't read and compile these bootstrap files due to unsupported mixed return types in PHP <8.0 (we are using PHP 7.4).

Please consider to add post cleanup script for composer to remove these files after install/update polyfill packages if PHP version is less than 8.0. You can found example of cleanup implementation here:
https://github.com/googleapis/google-api-php-client#cleaning-up-unused-services
https://github.com/googleapis/google-api-php-client/blob/master/src/Task/Composer.php#L31

@nicolas-grekas
Copy link
Member

This should be fixed on appstract/laravel-opcache's side instead.
It's perfectly legit for any lib to ship files that are conditionally loaded on some version of PHP.
Altering the polyfills won't fix the root cause, which is a wrong assumption coded in appstract/laravel-opcache.

@derrabus
Copy link
Member

Related: appstract/laravel-opcache#122

@nicolas-grekas
Copy link
Member

Thanks for the link.

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