-
Notifications
You must be signed in to change notification settings - Fork 406
Annotations-related syntax errors in the minified WordPress build #985
Copy link
Copy link
Closed
Labels
[Aspect] WordPress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Loading WordPress on PHP 7.4 yields the following error:
Parse error: syntax error, unexpected 'has' (T_STRING) in /wordpress/wp-includes/class-wp-recovery-mode-email-service.php on line 4
This is caused by the minification of PHP files via php -w.
PHP 8.0, which is currently used, outputs:
<?php
#[AllowDynamicProperties] final class WP_Recovery_Mode_Email_Service { /* ... code ... */ $message = __( 'Howdy!', '
WordPress has a built-in feature ...The class declaration is treated as a comment by PHP 7.4.
However, PHP 7.4 outputs:
<?php
final class WP_Recovery_Mode_Email_Service { /* ... code ... */ $message = __( 'Howdy!', '
WordPress has a built-in feature ...Note the missing annotation.
Proposed solution
I have two ideas:
- Postprocess the minified files and insert newline after each annotation
- Produce two separate minified WordPress builds for PHP >= 8.0 and PHP < 8.0
I'll explore the first one
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Aspect] WordPress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.