Skip to content

Stdlib: date_parse() unparsed hour/minute/second — false not 0 (#11068) - #11075

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-11068-date-parse-unparsed-fields
Jun 24, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-11068-date-parse-unparsed-fields

Conversation

@PurHur

@PurHur PurHur commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • date_parse('2024-01-01') now leaves hour/minute/second/fraction as boolean false when absent from the input, matching php-src ext/standard/parsedate.c
  • Component-aware parseDateComponents() path avoids expanding date-only strings through localtime() (which always produced midnight zeros)

php-src reference

  • ext/standard/parsedate.c — field initialization for unparsed components
  • PHP implementation: ext/standard/VmDateTimeNative.php (parseDateComponents)

Verification

php test/repro-maintainer/parity_date_parse_unparsed_fields.php
php bin/vm.php test/repro-maintainer/parity_date_parse_unparsed_fields.php
# both: ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter date_parse_unparsed_fields'
# OK (2 tests, 2 assertions)

php bin/compile.php -l test/repro-maintainer/parity_date_parse_unparsed_fields.php
# lint ok

Closes #11068

Made with Cursor

date_parse('2024-01-01') must leave hour/minute/second/fraction as boolean false when absent from the input, matching php-src parsedate.c — not midnight zeros from localtime expansion.

Closes #11068

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 381680a into master Jun 24, 2026
@PurHur
PurHur deleted the agent/issue-11068-date-parse-unparsed-fields branch June 24, 2026 02:56
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: date_parse() unparsed hour/minute/second — 0 not false (ext/standard/parsedate.c)

1 participant