Skip to content

test: use strcmp instead of deprecated strcoll in function generator test - #590

Merged
lisachenko merged 1 commit into
masterfrom
claude/goaop-fix-php86-strcoll-test
Aug 25, 2026
Merged

test: use strcmp instead of deprecated strcoll in function generator test#590
lisachenko merged 1 commit into
masterfrom
claude/goaop-fix-php86-strcoll-test

Conversation

@lisachenko

Copy link
Copy Markdown
Member

What

Fixes the experimental PHP 8.6 CI failure InterceptedFunctionGeneratorTest::testGenerate@strcoll by swapping the dataset function from strcoll to strcmp.

Why

PHP 8.6 added #[\Deprecated(message: 'use Collator::compare() instead', since: '8.6')] to strcoll(). 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:

-'function strcoll(string $string1, string $string2): int'
+'#[\Deprecated(message: 'use Collator::compare() instead', since: '8.6')]
+function strcoll(string $string1, string $string2): int'

The dataset only exists to cover "internal function with two string parameters returning int" — strcmp has 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 the funcWithAttributes dataset.

Validation

Reproduced the failure on PHP 8.6.0beta2 first, then after the change:

  • PHP 8.6.0beta2: full suite green (2474 tests, no failures — previously 1 failure)
  • PHP 8.5.9 / PHP 8.4.24: InterceptedFunctionGeneratorTest green (10 tests)

🤖 Generated with Claude Code

https://claude.ai/code/session_01V1Z87HZ2iz23WPTtTYqFxE


Generated by Claude Code

…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
@lisachenko
lisachenko marked this pull request as ready for review August 25, 2026 19:38
@lisachenko
lisachenko merged commit fd4501d into master Aug 25, 2026
7 checks passed
@lisachenko
lisachenko deleted the claude/goaop-fix-php86-strcoll-test branch August 25, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants