You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not clear if the omission of null from the type specification before 8.4 was deliberate. The docs for PHP do not mention this. They also include an example whereby a null is provided as the value for the $callback argument, which appears to work fine with 8.0 <= PHP < 8.4.
So this appears to be a bug in the stub. It is causing PHPStan to report incorrect errors against valid code, including against the example provided in the PHP docs:
The stub for
ob_start
is missingnull
in the type specification for the$callback
argument for 8.0 <= PHP < 8.4.https://github.com/phpstan/php-8-stubs/blob/main/stubs/ext/standard/ob_start.php
It's not clear if the omission of
null
from the type specification before 8.4 was deliberate. The docs for PHP do not mention this. They also include an example whereby a null is provided as the value for the$callback
argument, which appears to work fine with 8.0 <= PHP < 8.4.https://www.php.net/manual/en/function.ob-start.php
So this appears to be a bug in the stub. It is causing PHPStan to report incorrect errors against valid code, including against the example provided in the PHP docs:
phpstan/phpstan#12282
The text was updated successfully, but these errors were encountered: