test: use strcmp instead of deprecated strcoll in function generator test - #590
Merged
Merged
Conversation
…test PHP 8.6 added #[\Deprecated(message: 'use Collator::compare() instead', since: '8.6')] to strcoll(). The function generator intentionally mirrors native attributes into generated signatures, so the exact-match expectation for strcoll became version-dependent and failed the experimental PHP 8.6 CI jobs. The dataset only needs an internal function with two string parameters returning int, so strcmp keeps the assertion exact on every PHP version. Attribute propagation itself stays covered by the funcWithAttributes dataset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1Z87HZ2iz23WPTtTYqFxE
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.
What
Fixes the experimental PHP 8.6 CI failure
InterceptedFunctionGeneratorTest::testGenerate@strcollby swapping the dataset function fromstrcolltostrcmp.Why
PHP 8.6 added
#[\Deprecated(message: 'use Collator::compare() instead', since: '8.6')]tostrcoll(). The function generator intentionally mirrors native attributes into generated proxy signatures (that behavior is correct — the proxy should carry the deprecation), so on 8.6 the generated code gains the attribute line and the exact-match assertion fails:The dataset only exists to cover "internal function with two string parameters returning
int" —strcmphas the identical shape, is not deprecated, and keeps the expectation exact on every PHP version. Hardcoding the 8.6 deprecation message was rejected because its wording may still change during the beta cycle; attribute propagation itself remains covered by thefuncWithAttributesdataset.Validation
Reproduced the failure on PHP 8.6.0beta2 first, then after the change:
InterceptedFunctionGeneratorTestgreen (10 tests)🤖 Generated with Claude Code
https://claude.ai/code/session_01V1Z87HZ2iz23WPTtTYqFxE
Generated by Claude Code