You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
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
The text was updated successfully, but these errors were encountered: