Skip to content

Revert testNow behavior in createFromFormat for BC#503

Merged
dereuromark merged 1 commit into3.xfrom
revert-testnow-createfromformat
Mar 14, 2026
Merged

Revert testNow behavior in createFromFormat for BC#503
dereuromark merged 1 commit into3.xfrom
revert-testnow-createfromformat

Conversation

@dereuromark
Copy link
Member

@dereuromark dereuromark commented Mar 14, 2026

Summary

Reverts the testNow behavior change in createFromFormat() introduced in 3.3.2 for BC compatibility.

The Problem

The change in 3.3.2 that made createFromFormat() respect testNow for missing components was a BC break. Users expect createFromFormat() to behave exactly like PHP's native DateTimeImmutable::createFromFormat().

The Fix

createFromFormat() now behaves exactly like PHP's native method - testNow has no effect on it.

The testNow feature for createFromFormat() may be re-added as opt-in in a future major version.

@dereuromark dereuromark force-pushed the revert-testnow-createfromformat branch from 094a06d to b8cdd8c Compare March 14, 2026 17:00
@dereuromark dereuromark changed the title Revert testNow behavior in createFromFormat for BC Make testNow in createFromFormat opt-in for BC Mar 14, 2026
The change in 3.3.2 that made createFromFormat respect testNow for
missing components was a BC break. This reverts that behavior.

createFromFormat now behaves exactly like PHP's native
DateTimeImmutable::createFromFormat - testNow has no effect.

The testNow feature for createFromFormat may be re-added as opt-in
in a future major version.
@dereuromark dereuromark force-pushed the revert-testnow-createfromformat branch from b8cdd8c to 41a94b8 Compare March 14, 2026 17:02
@dereuromark dereuromark changed the title Make testNow in createFromFormat opt-in for BC Revert testNow behavior in createFromFormat for BC Mar 14, 2026
@dereuromark dereuromark merged commit 960e7ec into 3.x Mar 14, 2026
8 checks passed
@dereuromark dereuromark deleted the revert-testnow-createfromformat branch March 14, 2026 17:03
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.

1 participant