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

Plugin fatal errors under PHP 5.6 #58

Open
ironprogrammer opened this issue Aug 12, 2022 · 0 comments
Open

Plugin fatal errors under PHP 5.6 #58

ironprogrammer opened this issue Aug 12, 2022 · 0 comments

Comments

@ironprogrammer
Copy link

ironprogrammer commented Aug 12, 2022

Issue

The following fatal error occurs when the activated plugin's environment is switched to PHP 5.6, which as of this writing is still supported by WordPress.

Catchable fatal error: Argument 1 passed to WPCOTool\Plugin::__construct() must be an instance of WPCOTool\string, string given, called in .../contributor-orientation-tool/contributor-orientation-tool.php on line 32 and defined in .../contributor-orientation-tool/src/WPCOTool/Plugin.php on line 74

The error stems from use of the string scalar type declaration in class constructors, support for which was added in PHP 7.0.

I came across this issue after switching PHP versions to test a PHP-version-specific WordPress core patch.

PHP Support

I understand that the plugin is marked as requiring a minimum of PHP 7.0, however, the source of this fatal error may not be apparent to some users. Preventing the occurrence of the resultant white screen of death would be a preferable alternative 😂 ...at least until PHP 5.6 support is officially dropped.

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

1 participant