ext/pcntl: fix declared signature of pcntl_signal($restart_syscalls) - #23531
Open
lacatoire wants to merge 3 commits into
Open
ext/pcntl: fix declared signature of pcntl_signal($restart_syscalls)#23531lacatoire wants to merge 3 commits into
lacatoire wants to merge 3 commits into
Conversation
pcntl_signal() parses its third argument with Z_PARAM_BOOL_OR_NULL(), so null is accepted, and null is also what selects the SIGALRM specific default of false. The stub declared a non-nullable bool defaulting to true, so Reflection reported a signature the implementation does not honour. Every other Z_PARAM_BOOL_OR_NULL() user declares a nullable parameter defaulting to null: imageinterlace(), json_decode(), libxml_use_internal_errors() and sapi_windows_vt100_support(). Align pcntl_signal() with them. Runtime behaviour is unchanged: null was already accepted, and null and an omitted argument already took the same path.
Member
|
fix is good but you might be able to test it with |
…lls) Covers the nullable third parameter under declare(strict_types=1): the reflected type and default, null/true/false and the omitted argument, and the TypeError raised for a non-bool.
NickSdot
reviewed
Sep 1, 2026
Co-authored-by: NickSdot <32384907+NickSdot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pcntl_signal()parses its third argument withZ_PARAM_BOOL_OR_NULL(), sonullis accepted, andnullis also what selects theSIGALRMspecific default offalse:The stub, however, declared a non-nullable
booldefaulting totrue, so Reflection reported a signature the implementation does not honour:Every other
Z_PARAM_BOOL_OR_NULL()user declares a nullable parameter defaulting tonull—imageinterlace(),json_decode(),libxml_use_internal_errors()andsapi_windows_vt100_support(). This alignspcntl_signal()with them.Runtime behaviour is unchanged:
nullwas already accepted, andnulland an omitted argument already took the same path. What changes is the declared signature, so Reflection now reports?bool $restart_syscalls = null.Fixes #23530