Open
Description
The stub for ob_start
is missing null
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:
Metadata
Metadata
Assignees
Labels
No labels