Skip to content

fix: passthru on PHP 8.1#691

Merged
silasjoisten merged 6 commits intomasterfrom
fix/passthru
May 15, 2025
Merged

fix: passthru on PHP 8.1#691
silasjoisten merged 6 commits intomasterfrom
fix/passthru

Conversation

@silasjoisten
Copy link
Collaborator

@silasjoisten silasjoisten commented May 14, 2025

The passthru() documentation has been fixed in PHP 8.2. Prior to that, the mention to the the false return value on failure was missing.

closes #675

Fix PHPStan error by conditionally passing $result_code to passthru()

PHPStan reported that \passthru() never assigns null to the $result_code parameter,
so the nullable by-ref type caused a mismatch. This fix avoids passing the $result_code
parameter when it is null, preventing PHPStan from raising an error while keeping the
optional signature intact.

Big thanks to @cedric-anne for proposing the initial PR.

@silasjoisten silasjoisten changed the title fix: passthru fix: passthru on PHP 8.1 May 14, 2025
@silasjoisten silasjoisten requested review from OskarStark and shish May 14, 2025 16:48
Copy link
Collaborator

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silasjoisten silasjoisten merged commit c40d0f2 into master May 15, 2025
10 checks passed
@silasjoisten silasjoisten deleted the fix/passthru branch May 15, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants