Skip to content

Stdlib: DatePeriod::getEndDate() — recurrence null, end-date clone (#17495) - #17499

Merged
PurHur merged 2 commits into
masterfrom
agent/issue-17495-dateperiod-get-end-date
Jul 9, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/issue-17495-dateperiod-get-end-date

Conversation

@PurHur

@PurHur PurHur commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement DatePeriod::getEndDate() on VM per php-src date_period_get_end_date() — returns null for recurrence-count constructors and a cloned DateTimeInterface for end-date overloads.
  • Register DatePeriodGetEndDate builtin and extend accessor compliance coverage.
  • Spine-sync DatePeriodGetEndDate.php and pending ReflectionPropertyHasHooks.php into compiler_lib_spine_smoke (+ inventory/profile regen).

php-src reference

  • ext/date/php_date.c — date_period_get_end_date()

PHP implementation

  • lib/VM/DatePeriodSupport.php — getEndDate()
  • lib/VM/Builtin/DatePeriodGetEndDate.php — VM method handler
  • lib/VM/BuiltinClasses.php — registration

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro/maintainer_gap_dateperiod_get_end_date.php
php bin/vm.php test/repro/maintainer_gap_dateperiod_get_end_date.php
'
# ok / ok

./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit test/compliance/VMTest.php --filter "dateperiod_get_end_date|dateperiod_accessor_methods"'
# OK (2 tests, 2 assertions)

php script/bootstrap-inventory.php --check
# OK 4292/4292

php script/check-selfhost-spine-coverage-sync.php
# check-selfhost-spine-coverage-sync: OK (spine covers all 4292 inventory files)

Closes #17495

Made with Cursor

PurHur and others added 2 commits July 9, 2026 18:42
…e periods (#17495).

Expose php-src date_period_get_end_date on VM — null for recurrence-count
constructors, cloned DateTimeInterface for end-date overload; sync spine for
DatePeriodGetEndDate and ReflectionPropertyHasHooks inventory paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
…e entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f3c6963 into master Jul 9, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-17495-dateperiod-get-end-date branch July 9, 2026 18:44
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.

Stdlib: DatePeriod::getEndDate() missing — returns null for recurrence-count periods (ext/date/php_date.c)

1 participant