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
When used in PHP 7.4, one sees the following: PHP Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in [...]/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php on line 31.
Attributes are a php8 feature so you cannot use this class on 7.4 anyway and I'm not sure what you are doing?
Thank you for the quick response.
The attribute class isn't used in the PHP 7.4 project I'm referencing, but the monolog vendor directory is preloaded into opcache. This is done for performance purposes but with monolog version 2.4.0 that is also where this issue arises.
The file can be explicitly excluded from preloading, but I would like to hear your thoughts first.
The file src/Monolog/Attribute/AsMonologProcessor.php in monolog version 2.4.0 uses constructor property promotion (lines 31-33) which was introduced in PHP version 8.0.
When used in PHP 7.4, one sees the following:
PHP Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in [...]/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php on line 31
.The issue here is the fact that the composer.json file and therefore the monolog/monlog packagist page lists the PHP version requirement as
">=7.2"
.The text was updated successfully, but these errors were encountered: