-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Mark ob_start() callback parameter nullable #13103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark ob_start() callback parameter nullable #13103
Conversation
@kocsismate For your review as this is strictly a stub file change. |
Nice catch, thank you! |
Hi @kocsismate, Stubs of PHP 8.0, 8.1, 8.2 and 8.3 branches are currently wrong and some tools like PHPStan are using them. I know some of these version are EOL but since it's only a stub update would it be ok to backport this PR ? |
@VincentLanglet I can backport it for PHP 8.3 for sure, but we have never done similar changes in EOL or security fix only branches. AFAIK PHPStan has its own sources of type info besides the official PHP stubs, so they could fix the type info somewhere else. |
@VincentLanglet Fix for PHP 8.3: 701f3a1 |
Phpstan rely a lot on PHP stub for php 8+ and the override is not always easy. But it's ok, a fix was made on phpstan to automatically update the phpdoc to add "|null" when the default value is null. |
Thanks for the info! When I had a discussion with Ondrej a few years ago, he told me that multiple type sources are merged together. But maybe it was related to other symbols, or it's also possible that I didn't exactly understood what he mentioned. |
Yes, PHPStan rely on multiple source
|
Mark the
$callback
callable parameter ofob_start()
as nullable. The parameter is already nullable and is needed for using the default output handler with user-definedchunk_size
and/orflags
.