Skip to content

Add runtime detection for PHP 8.6+ SplFileObject iterator fix (php/php-src#21679) #326

@rene-hermenau

Description

@rene-hermenau

Problem

PHP PR php/php-src#21679 (merged into php-src master = PHP 8.6) fixes 5 SplFileObject iterator desync bugs (GH-8561 through GH-8564, GH-8851) that existed since PHP 8.0.1. Our AbstractFileObject class has version-specific workarounds for these bugs. When the fix ships, the workarounds will actively break things.

Solution

Add a runtime behavior probe that detects whether the current PHP has the fix, instead of version checks (the fix could be backported to any patch release). When fixed PHP is detected, all methods delegate to parent SplFileObject. Existing workarounds for PHP 7.0-8.5 stay untouched.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions