[DOC-CVS] [doc-en] master: PHP 8.4: Document some changes to ext/date (#4064)

[email protected] (Gina Peter Banyard via GitHub) Wed, 10 Jun 2026 17:16:17 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Gina Peter Banyard (Girgias)
Committer: GitHub (web-flow)
Pusher: jordikroon
Date: 2026-06-10T19:16:14+02:00

Commit: https://github.com/php/doc-en/commit/9eb962113cadccc164d196003062ff5d893de3a5
Raw diff: https://github.com/php/doc-en/commit/9eb962113cadccc164d196003062ff5d893de3a5.diff

PHP 8.4: Document some changes to ext/date (#4064)

* PHP 8.4: Date tentative return type changes
* PHP-8.4: Document deprecation of on signature for DatePeriod::__construct()

Co-authored-by: Jordi Kroon <[email protected]>

Changed paths:
  M  reference/datetime/dateinterval/createfromdatestring.xml
  M  reference/datetime/dateperiod/construct.xml
  M  reference/datetime/datetime/modify.xml
  M  reference/datetime/datetimeimmutable/modify.xml


Diff:

diff --git a/reference/datetime/dateinterval/createfromdatestring.xml b/reference/datetime/dateinterval/createfromdatestring.xml
index 2c461344bdb4..789cdc409376 100644
--- a/reference/datetime/dateinterval/createfromdatestring.xml
+++ b/reference/datetime/dateinterval/createfromdatestring.xml
@@ -34,8 +34,8 @@
      <term><parameter>datetime</parameter></term>
      <listitem>
       <para>
-       A date with relative parts. Specifically, the <link
-       linkend="datetime.formats.relative">relative formats</link> supported
+       A date with relative parts. Specifically, the
+       <link linkend="datetime.formats.relative">relative formats</link> supported
        by the parser used for <classname>DateTimeImmutable</classname>,
        <classname>DateTime</classname>, and <function>strtotime</function>
        will be used to construct the DateInterval.
@@ -78,6 +78,11 @@
     </thead>
     <tbody>
      <row>
+      <entry>8.4.0</entry>
+      <entry>
+       Now has a tentative return type of <type>DateInterval</type>.
+       Previously it was <type class="union"><type>DateInterval</type><type>false</type></type>.
+      </entry>
       <entry>8.3.0</entry>
       <entry>
        <methodname>DateInterval::createFromDateString</methodname> now throws
diff --git a/reference/datetime/dateperiod/construct.xml b/reference/datetime/dateperiod/construct.xml
index ff475f023385..a84781939599 100644
--- a/reference/datetime/dateperiod/construct.xml
+++ b/reference/datetime/dateperiod/construct.xml
@@ -33,8 +33,8 @@
     <methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
    </constructorsynopsis>
    <simpara>
-    Instead the <methodname>DatePeriod::createFromISO8601String</methodname>
-    static factory method should be used.
+    This variant of the constructor is deprecated as of PHP 8.4.0, use
+    <methodname>DatePeriod::createFromISO8601String</methodname> instead.
    </simpara>
   </warning>
   <para>
@@ -163,6 +163,13 @@
       </row>
      </thead>
      <tbody>
+      <row>
+       <entry>8.4.0</entry>
+       <entry>
+        The signature using <parameter>isostr</parameter> has been deprecated,
+        use <methodname>DatePeriod::createFromISO8601String</methodname> instead.
+       </entry>
+      </row>
       <row>
        <entry>8.3.0</entry>
        <entry>
diff --git a/reference/datetime/datetime/modify.xml b/reference/datetime/datetime/modify.xml
index 46bd71034f16..73352a56c8c5 100644
--- a/reference/datetime/datetime/modify.xml
+++ b/reference/datetime/datetime/modify.xml
@@ -66,6 +66,13 @@
      </row>
     </thead>
     <tbody>
+     <row>
+      <entry>8.4.0</entry>
+      <entry>
+       Now has a tentative return type of <type>DateTime</type>.
+       Previously it was <type class="union"><type>DateTime</type><type>false</type></type>.
+      </entry>
+     </row>
      <row>
       <entry>8.3.0</entry>
       <entry>
diff --git a/reference/datetime/datetimeimmutable/modify.xml b/reference/datetime/datetimeimmutable/modify.xml
index ca14377daaf3..44716108f706 100644
--- a/reference/datetime/datetimeimmutable/modify.xml
+++ b/reference/datetime/datetimeimmutable/modify.xml
@@ -59,6 +59,13 @@
      </row>
     </thead>
     <tbody>
+     <row>
+      <entry>8.4.0</entry>
+      <entry>
+       Now has a tentative return type of <type>DateTimeImmutable</type>.
+       Previously it was <type class="union"><type>DateTimeImmutable</type><type>false</type></type>.
+      </entry>
+     </row>
      <row>
       <entry>8.3.0</entry>
       <entry>