Skip to content

Stdlib: IntlDateFormatter::formatObject / datefmt_format_object (#20813) - #20825

Merged
PurHur merged 1 commit into
masterfrom
fix/20813-datefmt-format-object
Jul 19, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/20813-datefmt-format-object

Conversation

@PurHur

@PurHur PurHur commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • IntlDateFormatter::formatObject() + datefmt_format_object() (php-src dateformat_format_object.cpp).
  • Accepts DateTimeInterface / IntlCalendar; format as [dateStyle,timeStyle], int style, pattern string, or null (MEDIUM/MEDIUM).
  • datefmt_format / format() now resolve IntlCalendar instants.
  • PHP-in-PHP; no new runtime/ C.

Closes #20813

Test plan

  • PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_20813_datefmt_format_object.php
    method=yes
    fn=yes
    arr=1/15/24
    proc=1/15/24
    pat=2024-01-15
    cal=1/15/24
    
  • vendor/bin/phpunit --filter intl_datefmt_format_object → OK (2 tests, VM+JIT, 3×)
  • capability-matrix + bootstrap-inventory + check-generated-docs → in sync

php-src-strict; no php-compiler-strict shortcut.

Made with Cursor

Add static formatObject and procedural datefmt_format_object for DateTime
and IntlCalendar inputs (style array, int style, or pattern string). Also
teach datefmt_format to accept IntlCalendar instants.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur force-pushed the fix/20813-datefmt-format-object branch from 3749192 to 77e2666 Compare July 19, 2026 03:49
@PurHur
PurHur merged commit a8d95f0 into master Jul 19, 2026
1 check failed
@PurHur
PurHur deleted the fix/20813-datefmt-format-object branch July 19, 2026 03:49
PurHur added a commit that referenced this pull request Jul 19, 2026
…20819 (#10533) (#20831)

Restore 5853/5853 spine coverage and gen-0 sidecar stamp so north-star5-fast and user_release_ready stay green after formatObject / DatePatternGenerator landed without spine requires.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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: IntlDateFormatter::formatObject()/datefmt_format_object() missing (ext/intl/dateformat)

1 participant