Hello,
Thanks for the detailed report. Honestly, this is the first time we are told of a similar compiler error, because that’s actually what developers should do in order to comply with the new PHP 8.1.
Moreover, the line of code involved is a PHP comment at all the effects. PHP comments can start with a leading double slash // or with an hash #. That’s a particular “comment” though, as it tells some PHP versions the necessary information about the return type of some methods.
It wouldn’t cost us anything to remove that comment, but it’s actually needed. The WordPress core framework itself will start using this technique in a near future in order to comply with the latest PHP versions.
We suggest getting in touch with your hosting company to ask for more information regarding that “false error” you got. I’m sure that if you change PHP version that error will disappear. However, it’s important to highlight that is not an incompatibility issue with an old PHP version, it’s an incompatibility issue with the way your PHP version was compiled, because that line of code should be a comment for any PHP version, and for the most recent ones, it should tell you how to treat the “return type” for certain functions (methods).
Best regards,
The VikWP Team
Thank you very much for the information, I have contacted the hosting company and after updating the version of php, the error has been solved. Thank you very much for your reply.
Best regards.