PHP 8.0 | :sparkles: New `PHPCompatibility.ParameterValues.ForbiddenGetClassNoArgsOutsideOO` sniff by jrfnl · Pull Request #1602 · PHPCompatibility/PHPCompatibility
8.0.0 Calling this function from outside a class, without any arguments, will now throw an
Error.
Previously, anE_WARNINGwas raised and the function returnedfalse.
Applies to both get_class() as well as get_called_class().
Refs:
- https://www.php.net/manual/en/function.get-class.php#refsect1-function.get-class-changelog
- php/php-src@213b666
- https://3v4l.org/f05rn
- https://3v4l.org/a7h7r
This adds a new sniff to detect the above, which wasn't mentioned in the PHP 8.0 generic changelog nor in the migration guide, though a note about it can be found on the functions manual pages.
Includes tests and documentation.
Related to #809