Skip to content

Conversation

@b-viguier
Copy link

@b-viguier b-viguier commented Jan 2, 2026

ℹ️ Documentation tracker #3872

Adding new DateTime functions added in 8.4

⚠️ According to my tests, it seems that createFromTimestamp accepts some timestamp values below PHP_INT_MIN (until PHP_INT_MIN - 1024, see related tests).
Since returned date are all the same for this specific values, I think it may be an error, because it doesn't throw any exception.
I'm not sure if we should document the actual bogus behavior, to prevent anyone to rely on this 🤔

Also:

  • I'm not native English speaker
  • This is my first PR on PHP's doc

Then, no offense if you think it can be improved 🙂

Thanks for your huge work, happy if this PR can help 🙇

@b-viguier b-viguier marked this pull request as ready for review January 2, 2026 20:41
<refentry xml:id="datetimeimmutable.createfromtimestamp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateTimeImmutable::createFromTimestamp</refname>
<refpurpose>Returns new DateTimeImmutable object representing given Unix timestamp</refpurpose>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?

Suggested change
<refpurpose>Returns new DateTimeImmutable object representing given Unix timestamp</refpurpose>
<refpurpose>Creates an instance from a Unix timestamp</refpurpose>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 🙂 👍

@Girgias Girgias requested a review from derickr January 9, 2026 00:55
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.

3 participants