Skip to content

PHP 8.6: internal functions gaining #[\Deprecated] (e.g. strcoll()) should be reflected correctly #215

Description

@lisachenko

Context

While bumping goaop/framework to the stable goaop/parser-reflection ^4.0 release (goaop/framework#587), the experimental PHP 8.6 CI job surfaced a new engine-level deprecation:

1) Go\Proxy\Part\InterceptedFunctionGeneratorTest::testGenerate@strcoll with data ('strcoll', 'function strcoll(string $stri...): int')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'function strcoll(string $string1, string $string2): int'
+'#[\Deprecated(message: 'use Collator::compare() instead', since: '8.6')]
+function strcoll(string $string1, string $string2): int'

(full run: https://github.com/goaop/framework/actions/runs/32814791246/job/97700803191)

PHP 8.6 attaches #[\Deprecated] to a number of previously-undeprecated internal functions (strcoll() is the one caught here; there were 27 deprecation notices total in that run). This library added isDeprecated() / #[\Deprecated] support for user-defined functions in 4.0 (see the feat: fill PHP 8.1-8.4 function-like reflection gaps and #[Deprecated] support change), but internal functions like strcoll() have no PHP source for the AST parser to read — ReflectionFunction falls back to native reflection for them, so isDeprecated() should already report true on 8.6 without any code change here.

Ask

This is a tracking issue for PHP 8.6 support, not a confirmed bug:

  • Confirm Go\ParserReflection\ReflectionFunction::isDeprecated() (and getAttributes()) correctly reflect the native fallback's #[\Deprecated] status for internal functions like strcoll() under PHP 8.6.
  • Consider adding a PHP 8.6 test stub/parity test alongside the existing 8.1–8.4 #[\Deprecated] coverage, since parser-reflection's own CI (.github/workflows/phpunit.yml) also runs PHP 8.6 as an experimental job.

Filed against parser-reflection since this repo owns the reflection/deprecation-attribute logic and already tracks PHP 8.6 experimental support (#201); the concrete failure was observed downstream in goaop/framework's proxy-generator tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions