Skip to content

keep DateTimeImmutable inner and outer dates in sync, fixes #759 - #760

Open
JoniJnm wants to merge 1 commit into
thecodingmachine:masterfrom
JoniJnm:fix/759-datetimeimmutable-constructor
Open

JoniJnm wants to merge 1 commit into
thecodingmachine:masterfrom
JoniJnm:fix/759-datetimeimmutable-constructor

Conversation

@JoniJnm

@JoniJnm JoniJnm commented Oct 16, 2026

Copy link
Copy Markdown

The constructor created the parent and the inner \DateTimeImmutable separately, so relative times like 'now' could differ by microseconds between the two, breaking diff() and comparisons. Build the inner date first and initialise the parent from its exact value and timezone.

fixes #759

…machine#759

The constructor created the parent and the inner \DateTimeImmutable
separately, so relative times like 'now' could differ by microseconds
between the two, breaking diff() and comparisons. Build the inner date
first and initialise the parent from its exact value and timezone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JoniJnm
JoniJnm force-pushed the fix/759-datetimeimmutable-constructor branch from 9212305 to 7487888 Compare October 16, 2026 11:38
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.

Broken Function: DateTimeImmutable

1 participant