Skip to content

Regression: DateMalformedPeriodException class_exists true on PHP 8.2 reference profile (ext/date/php_date.c) #16888

Closed

Description

@PurHur

Category

stdlib · php-src-strict · PHP 8.3+ date exception hierarchy phantom gate

Problem

DateMalformedPeriodException is a PHP 8.3+ class in php-src. On the Zend 8.2 reference profile, class_exists('DateMalformedPeriodException') is false. This compiler registers the class unconditionally — class_exists returns true on the default profile, a phantom parity gap vs Zend 8.2.

Repro Zend 8.2 VM (2026-07-06)
class_exists('DateMalformedPeriodException') false true ❌

Sibling DateMalformedIntervalException may share the same gate drift (audit both).

php-src reference

PHP implementation target

  • ext/date/Module.php — gate registration on CompilerVersion::supportsDateMalformedExceptions() (or equivalent 8.3+ profile flag)
  • lib/CompilerVersion.php — introspection policy aligned with Zend reference profile

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php -r "var_export(class_exists(\"DateMalformedPeriodException\"));" && php bin/vm.php -r "var_export(class_exists(\"DateMalformedPeriodException\"));"'
# Zend: false · VM: true

Done when

  • class_exists('DateMalformedPeriodException') is false on 8.2 reference profile; true only when profile ≥ 8.3
  • Compliance guard under test/compliance/cases/date/
  • php-src-strict; pairs with DateMalformedIntervalException if applicable

Activity

  1. added
    bugSomething isn't working
    enhancementNew feature or request
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 6, 2026
  2. PurHur commented on Jul 6, 2026

    @PurHur
    OwnerAuthor

    claim: cursor-agent-lane-b — starting this run

  3. PurHur commented on Jul 6, 2026

    @PurHur
    OwnerAuthor

    claim released: repro green on master — both Zend 8.2 and VM return false for class_exists('DateMalformedPeriodException'); ThrowableProfilePhantomTest passes. Pivoting to next lane-B issue.

  4. PurHur commented on Jul 6, 2026

    @PurHur
    OwnerAuthor

    claim: cursor-agent-lane-b — behavior green on master; adding missing reference-profile compliance guard per done-when.

  5. PurHur commented on Jul 6, 2026

    @PurHur
    OwnerAuthor

    Merged via #16896.

    Root cause: Runtime behavior was already correct (ThrowableManifest::isAdvertised + CompilerVersion::advertisesDateExceptionHierarchy()), but reference-profile compliance tests were never executed — VMTest/JITTest skipped any case name containing dateexception/date_malformed without exempting reference_profile (unlike request_parse_body_exception).

    Fix: Exempt reference_profile from the reference-profile skip; extend dateexception_reference_profile.phpt; add test/compliance/cases/date/date_malformed_exceptions_phantom_reference_profile.phpt + maintainer repro.

    Verification:

    php -r "var_export(class_exists('DateMalformedPeriodException'));"  # false
    php bin/vm.php -r "var_export(class_exists('DateMalformedPeriodException'));"  # false
    vendor/bin/phpunit --filter 'dateexception_reference_profile|date_malformed_exceptions_phantom'  # OK (4)
    
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

    area:vmVirtual machinebugSomething isn't workingenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions