Skip to content

Conversation

datibbaw
Copy link
Contributor

Analogous to how strncmp() handles a zero length comparison, substr_compare() with a zero length should return 0 as well.

Example:

substr_compare("abc", "a", 0, 0); // 0
substr_compare("abc", "a", 0, -1); // false (with warning)

This patch also cleans up logic prior to bug #33605

@realityking
Copy link
Contributor

I believe this has been merged with 2e459be

@php-pulls
Copy link

Comment on behalf of datibbaw at php.net:

Merged in 5.5 onwards.

@php-pulls php-pulls closed this Mar 2, 2014
@datibbaw
Copy link
Contributor Author

datibbaw commented Mar 2, 2014

@realityking Yeah, I've merged it from 5.5 branch onwards, but had to cherry pick the commits :)

@datibbaw datibbaw deleted the substr_compare-zero-length branch March 2, 2014 23:28
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