Skip to content

Conversation

cla7aye15I4nd
Copy link
Contributor

Description

This PR fixes a logical issue in the URL output handler where the final else branch was unreachable due to redundant conditionals.

Problem

The existing code had the following structure:

if (ZSTR_LEN(url_state->url_app.s) != 0) {
    // handle non-empty case
} else if (ZSTR_LEN(url_state->url_app.s) == 0) {
    // handle empty case  
} else {
    // unreachable branch
    *handled_output = NULL;
}

Since ZSTR_LEN() returns a size_t (unsigned integer), the value can only be either "not equal to 0" or "equal to 0". The third else branch was unreachable, making the *handled_output = NULL; assignment dead code.

@Girgias Girgias merged commit b068ee3 into php:master Jul 7, 2025
9 checks passed
@Girgias
Copy link
Member

Girgias commented Jul 7, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants