PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE)
-
I get this error since mid of May:
PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /home/www/<DOMAIN>/WordPress/wp-content/plugins/woocommerce/vendor/symfony/polyfill-php80/bootstrap.php on line 29The PHP version on the server is 7.4
I tried to fix it by deleting the bold and italic questionmarks in the code below:
function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? ”, $needle ?? ”); }
function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? ”, $needle ?? ”); }
That helped with this individual error but then a next error showed up:
PHP Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in /home/www/<DOMAIN>/WordPress/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/Definition.php on line 18I did not try to fix this one.
What should I do here?
(Switching to PHP 8.0 does not work for my site for unknown reason)The system status report does not tell any errors
Martin
- This topic was modified 2 years, 5 months ago by .
- This topic was modified 2 years, 5 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE)’ is closed to new replies.