Skip to content

Guard DateMalformed* phantom classes on 8.2 reference profile (#16888) - #16896

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-16888-date-malformed-phantom-guard
Jul 6, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-16888-date-malformed-phantom-guard

Conversation

@PurHur

@PurHur PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix VMTest/JITTest date-hierarchy skip so *reference_profile* compliance cases actually run on the 8.2 reference profile (mirrors request_parse_body pattern).
  • Extend dateexception_reference_profile.phpt and add test/compliance/cases/date/date_malformed_exceptions_phantom_reference_profile.phpt to assert DateMalformedIntervalException / DateMalformedPeriodException are absent when CompilerVersion::advertisesDateExceptionHierarchy() is false.
  • Add maintainer repro test/repro/maintainer_gap_date_malformed_exceptions_phantom_reference_profile.php.

Closes #16888

php-src reference

  • ext/date/php_date.c — PHP 8.3+ date exception hierarchy registration gated by version

Verification

./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\"));"
# false / false

php test/repro/maintainer_gap_date_malformed_exceptions_phantom_reference_profile.php
php bin/vm.php test/repro/maintainer_gap_date_malformed_exceptions_phantom_reference_profile.php
# ok / ok

vendor/bin/phpunit --filter "dateexception_reference_profile|date_malformed_exceptions_phantom"
# OK (4 tests)

vendor/bin/phpunit --filter ThrowableProfilePhantomTest
# OK (3 tests)

Made with Cursor

…).

Reference-profile dateexception tests were skipped by VMTest/JITTest because
the filter did not exempt reference_profile cases. Extend the guard to cover
DateMalformedIntervalException and DateMalformedPeriodException phantom gates.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 47a43ae into master Jul 6, 2026
@PurHur
PurHur deleted the agent/issue-16888-date-malformed-phantom-guard branch July 6, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant