Repository navigation
Fix version_compare() shorter operand parity (#4796) - #5327
Merged
Merged
Conversation
Exclude '.' from digit/non-digit transition in php_canonicalize_version so '8.2.31' vs '8.2' compares like Zend. Matches php-src versioning.c isdig/isndig macros in VmInfo.php and phpc_info.c. Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
php_canonicalize_version()inext/standard/VmInfo.phpandlib/AOT/runtime/phpc_info.cto exclude.from the digit/non-digit transition branch, matching php-srcversioning.cisdig/isndigmacros.8.2.31canonicalized to8..2..31, causingversion_compare('8.2.31', '8.2', '>=')to returnfalseinstead of Zend'strue.version_compare_partial.phptand issue repro script.php-src reference
ext/standard/versioning.c—php_canonicalize_version(),php_version_compare()Verification
Output:
Note: AOT compile for
version_compare()with operator is pre-existing broken on master (LLVM ICmp type mismatch in JIT lowering); C canonicalize fix is aligned for when that path is restored.Closes #4796
Made with Cursor