Skip to content

fix(compatibility): remove undeclared PHP 8.4 mb_trim dependency from PHP 8.3 runtime #9

Closed

Description

@coisa

Problem

The package declares PHP ^8.3, but header helpers call mb_trim(), which is only built into PHP starting in 8.4. Neither a PHP 8.4 polyfill nor ext-mbstring is required by this package's runtime dependencies. Development tooling can hide this production-only gap.

Pinned evidence

Audited commit: a429fbe9a7efce6cee50b82e4a981ea7e3b47a5f.

Safe reproduction

In a clean PHP 8.3 consumer installed with --no-dev, load the Composer autoloader and call:

FastForward\Http\Message\Header\Accept::getBestMatch(
    'application/json',
    [FastForward\Http\Message\Header\Accept::ApplicationJson],
);

Expected: ApplicationJson. Source-predicted result without an unrelated polyfill: undefined-function Error for mb_trim. On newer PHP without mbstring, the undeclared extension requirement can also fail.

Acceptance criteria

  • Preserve the advertised PHP 8.3 support using appropriate ASCII header parsing, or declare and ship the necessary runtime compatibility dependency.
  • Cover all mb_* calls, not just Accept.
  • Add isolated no-dev consumer checks on PHP 8.3; ensure development dependencies cannot provide missing runtime functions accidentally.

Priority P1 (advertised runtime paths fail); confidence high. This is a runtime compatibility finding, not a vulnerability claim. Validation is source-level plus official function availability documentation; PHP execution was unavailable. All existing issue/PR records #1–#8 were checked and no matching task exists.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions