From 122d1ca5759b4d8a34a9bea7d6d252ebdb019964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Thu, 11 Jun 2026 16:01:53 +0900 Subject: [PATCH 1/4] =?UTF-8?q?PHP=208.4=20=E3=81=A7=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=20DateTime=20=E7=B3=BB=E3=83=A1?= =?UTF-8?q?=E3=82=BD=E3=83=83=E3=83=895=E4=BB=B6=E3=82=92=E6=96=B0?= =?UTF-8?q?=E8=A6=8F=E7=BF=BB=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原文: php/doc-en@726154e3c8 --- .../datetime/datetime/createfromtimestamp.xml | 95 +++++++++++++++ .../datetime/datetime/setmicrosecond.xml | 110 ++++++++++++++++++ .../datetimeimmutable/createfromtimestamp.xml | 95 +++++++++++++++ .../datetimeimmutable/setmicrosecond.xml | 106 +++++++++++++++++ .../datetimeinterface/getmicrosecond.xml | 94 +++++++++++++++ 5 files changed, 500 insertions(+) create mode 100644 reference/datetime/datetime/createfromtimestamp.xml create mode 100644 reference/datetime/datetime/setmicrosecond.xml create mode 100644 reference/datetime/datetimeimmutable/createfromtimestamp.xml create mode 100644 reference/datetime/datetimeimmutable/setmicrosecond.xml create mode 100644 reference/datetime/datetimeinterface/getmicrosecond.xml diff --git a/reference/datetime/datetime/createfromtimestamp.xml b/reference/datetime/datetime/createfromtimestamp.xml new file mode 100644 index 0000000000..391787132d --- /dev/null +++ b/reference/datetime/datetime/createfromtimestamp.xml @@ -0,0 +1,95 @@ + + + + + + DateTime::createFromTimestamp + Unix タイムスタンプからインスタンスを生成する + + + + &reftitle.description; + + public static staticDateTime::createFromTimestamp + intfloattimestamp + + + + Unix タイムスタンプからインスタンスを生成します。 + + + + + &reftitle.parameters; + + + + timestamp + + + 日付を表す Unix タイムスタンプ。 + &float; の値も受け付けるため、マイクロ秒の精度を指定できます。 + + + + + + + + + &reftitle.returnvalues; + + 新しい DateTime インスタンスを返します。 + + + + + &reftitle.errors; + + timestamp が [PHP_INT_MIN, PHP_INT_MAX] + の範囲外の場合、DateRangeError がスローされます。 + + + + + &reftitle.examples; + + <methodname>DateTime::createFromTimestamp</methodname> の例 + +format('Y-m-d H:i:s.u'); +?> +]]> + + &example.outputs; + + + + + + + + diff --git a/reference/datetime/datetime/setmicrosecond.xml b/reference/datetime/datetime/setmicrosecond.xml new file mode 100644 index 0000000000..16050be47f --- /dev/null +++ b/reference/datetime/datetime/setmicrosecond.xml @@ -0,0 +1,110 @@ + + + + + + DateTime::setMicrosecond + 時刻のマイクロ秒部分を設定する + + + + &reftitle.description; + + public staticDateTime::setMicrosecond + intmicrosecond + + + + 時刻のマイクロ秒部分を設定します。 + + + DateTimeImmutable::setMicrosecond に似ていますが、 + DateTime を使って動作します。 + + + + + &reftitle.parameters; + + + + microsecond + + + 設定するマイクロ秒の値 (0 から 999999)。 + + + + + + + + + &reftitle.returnvalues; + + &date.datetime.return.modifiedobject; + + + + + &reftitle.errors; + + microsecond が + [0, 999999] の範囲外の場合、 + DateRangeError がスローされます。 + + + + + &reftitle.examples; + + <methodname>DateTime::setMicrosecond</methodname> の例 + + +format('Y-m-d H:i:s.u') . PHP_EOL; +$date->setMicrosecond(987654); +echo $date->format('Y-m-d H:i:s.u') . PHP_EOL; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + DateTimeInterface::getMicrosecond + + + + + diff --git a/reference/datetime/datetimeimmutable/createfromtimestamp.xml b/reference/datetime/datetimeimmutable/createfromtimestamp.xml new file mode 100644 index 0000000000..62a6ee83cb --- /dev/null +++ b/reference/datetime/datetimeimmutable/createfromtimestamp.xml @@ -0,0 +1,95 @@ + + + + + + DateTimeImmutable::createFromTimestamp + Unix タイムスタンプからインスタンスを生成する + + + + &reftitle.description; + + public static staticDateTimeImmutable::createFromTimestamp + intfloattimestamp + + + + Unix タイムスタンプからインスタンスを生成します。 + + + + + &reftitle.parameters; + + + + timestamp + + + 日付を表す Unix タイムスタンプ。 + &float; の値も受け付けるため、マイクロ秒の精度を指定できます。 + + + + + + + + + &reftitle.returnvalues; + + 新しい DateTimeImmutable インスタンスを返します。 + + + + + &reftitle.errors; + + timestamp が [PHP_INT_MIN, PHP_INT_MAX] の範囲外の場合、 + DateRangeError がスローされます。 + + + + + &reftitle.examples; + + <methodname>DateTimeImmutable::createFromTimestamp</methodname> の例 + +format('Y-m-d H:i:s.u'); +?> +]]> + + &example.outputs; + + + + + + + + \ No newline at end of file diff --git a/reference/datetime/datetimeimmutable/setmicrosecond.xml b/reference/datetime/datetimeimmutable/setmicrosecond.xml new file mode 100644 index 0000000000..a5fdd20bb1 --- /dev/null +++ b/reference/datetime/datetimeimmutable/setmicrosecond.xml @@ -0,0 +1,106 @@ + + + + + + DateTimeImmutable::setMicrosecond + 時刻のマイクロ秒部分を設定する + + + + &reftitle.description; + + #[\NoDiscard(message: "as DateTimeImmutable::setMicrosecond() does not modify the object itself")] + public staticDateTimeImmutable::setMicrosecond + intmicrosecond + + + + 元のオブジェクトを基にマイクロ秒部分を変更した、 + 新しい DateTimeImmutable オブジェクトを返します。 + + + + + &reftitle.parameters; + + + + microsecond + + + 設定するマイクロ秒の値 (0 から 999999)。 + + + + + + + + + &reftitle.returnvalues; + + &date.datetimeimmutable.return.modifiedobject; + + + + + &reftitle.errors; + + microsecond が [0, 999999] + の範囲外の場合、DateRangeError がスローされます。 + + + + + &reftitle.examples; + + <methodname>DateTimeImmutable::setMicrosecond</methodname> の例 + +format('Y-m-d H:i:s.u') . PHP_EOL; +$date = $date->setMicrosecond(987654); +echo $date->format('Y-m-d H:i:s.u') . PHP_EOL; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + DateTimeInterface::getMicrosecond + + + + + diff --git a/reference/datetime/datetimeinterface/getmicrosecond.xml b/reference/datetime/datetimeinterface/getmicrosecond.xml new file mode 100644 index 0000000000..afa1ac798d --- /dev/null +++ b/reference/datetime/datetimeinterface/getmicrosecond.xml @@ -0,0 +1,94 @@ + + + + + + DateTimeInterface::getMicrosecond + DateTimeImmutable::getMicrosecond + DateTime::getMicrosecond + Unix タイムスタンプのマイクロ秒部分を取得する + + + + &reftitle.description; + + public intDateTimeInterface::getMicrosecond + + + + public intDateTimeImmutable::getMicrosecond + + + + public intDateTime::getMicrosecond + + + + Unix タイムスタンプのマイクロ秒部分を取得します。 + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + その日付をあらわす Unix タイムスタンプのマイクロ秒部分を返します。 + + + + + &reftitle.examples; + + <methodname>DateTimeInterface::getMicrosecond</methodname> の例 + +format('u')); +var_dump($date->getMicrosecond()); +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + DateTimeInterface::getTimestamp + DateTimeInterface::format + + + + + From 83b9b0b77955874c1e1a097696baa1704e9d98bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Thu, 11 Jun 2026 16:02:03 +0900 Subject: [PATCH 2/4] =?UTF-8?q?NoDiscard=20=E5=B1=9E=E6=80=A7=E3=81=AE=20m?= =?UTF-8?q?essage=20=E5=BC=95=E6=95=B0=E3=82=92=E5=8E=9F=E6=96=87=E3=81=AB?= =?UTF-8?q?=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6=E5=90=8C=E6=9C=9F=EF=BC=88?= =?UTF-8?q?6=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原文: php/doc-en@726154e3c8 --- reference/datetime/datetimeimmutable/add.xml | 4 ++-- reference/datetime/datetimeimmutable/setdate.xml | 4 ++-- reference/datetime/datetimeimmutable/setisodate.xml | 4 ++-- reference/datetime/datetimeimmutable/settime.xml | 4 ++-- reference/datetime/datetimeimmutable/settimezone.xml | 4 ++-- reference/datetime/datetimeimmutable/sub.xml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/datetime/datetimeimmutable/add.xml b/reference/datetime/datetimeimmutable/add.xml index f9e8a9a36b..76a57542cd 100644 --- a/reference/datetime/datetimeimmutable/add.xml +++ b/reference/datetime/datetimeimmutable/add.xml @@ -1,6 +1,6 @@ - + @@ -13,7 +13,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::add() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::add DateIntervalinterval diff --git a/reference/datetime/datetimeimmutable/setdate.xml b/reference/datetime/datetimeimmutable/setdate.xml index cc7efb784f..fdb6c97235 100644 --- a/reference/datetime/datetimeimmutable/setdate.xml +++ b/reference/datetime/datetimeimmutable/setdate.xml @@ -1,6 +1,6 @@ - + @@ -11,7 +11,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::setDate() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::setDate intyear intmonth diff --git a/reference/datetime/datetimeimmutable/setisodate.xml b/reference/datetime/datetimeimmutable/setisodate.xml index 1f1ae3b17d..e454c3c815 100644 --- a/reference/datetime/datetimeimmutable/setisodate.xml +++ b/reference/datetime/datetimeimmutable/setisodate.xml @@ -1,6 +1,6 @@ - + @@ -11,7 +11,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::setISODate() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::setISODate intyear intweek diff --git a/reference/datetime/datetimeimmutable/settime.xml b/reference/datetime/datetimeimmutable/settime.xml index 02b7896c0c..1d512f1899 100644 --- a/reference/datetime/datetimeimmutable/settime.xml +++ b/reference/datetime/datetimeimmutable/settime.xml @@ -1,6 +1,6 @@ - + @@ -12,7 +12,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::setTime() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::setTime inthour intminute diff --git a/reference/datetime/datetimeimmutable/settimezone.xml b/reference/datetime/datetimeimmutable/settimezone.xml index 25accce334..69f120177f 100644 --- a/reference/datetime/datetimeimmutable/settimezone.xml +++ b/reference/datetime/datetimeimmutable/settimezone.xml @@ -1,6 +1,6 @@ - + @@ -11,7 +11,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::setTimezone() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::setTimezone DateTimeZonetimezone diff --git a/reference/datetime/datetimeimmutable/sub.xml b/reference/datetime/datetimeimmutable/sub.xml index c1c1d14b02..af4402999d 100644 --- a/reference/datetime/datetimeimmutable/sub.xml +++ b/reference/datetime/datetimeimmutable/sub.xml @@ -1,6 +1,6 @@ - + @@ -13,7 +13,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::sub() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::sub DateIntervalinterval From 9237a7ca8d6516a77951027471c11b965050e0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Thu, 11 Jun 2026 16:02:15 +0900 Subject: [PATCH 3/4] =?UTF-8?q?PHP=208.4.0=20=E3=81=AE=E4=BB=AE=E3=81=AE?= =?UTF-8?q?=E6=88=BB=E3=82=8A=E5=80=A4=E3=81=AE=E5=9E=8B=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=AE=20changelog=20=E3=82=92=E8=BF=BD=E5=8A=A0=EF=BC=883?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原文: php/doc-en@9eb962113c および php/doc-en@726154e3c8(datetimeimmutable/modify.xml は NoDiscard 属性の同期を含む) --- .../datetime/dateinterval/createfromdatestring.xml | 7 ++++++- reference/datetime/datetime/modify.xml | 10 +++++++++- reference/datetime/datetimeimmutable/modify.xml | 12 ++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/reference/datetime/dateinterval/createfromdatestring.xml b/reference/datetime/dateinterval/createfromdatestring.xml index 6776fb829a..09d4e68fc0 100644 --- a/reference/datetime/dateinterval/createfromdatestring.xml +++ b/reference/datetime/dateinterval/createfromdatestring.xml @@ -1,6 +1,6 @@ - + @@ -85,6 +85,11 @@ + 8.4.0 + + 仮の戻り値の型が、DateInterval になりました。 + これより前のバージョンでは、DateIntervalfalse でした。 + 8.3.0 無効な文字列が渡された場合、 diff --git a/reference/datetime/datetime/modify.xml b/reference/datetime/datetime/modify.xml index 1517364c6f..74b1aa44e2 100644 --- a/reference/datetime/datetime/modify.xml +++ b/reference/datetime/datetime/modify.xml @@ -1,6 +1,6 @@ - + @@ -71,6 +71,14 @@ + + 8.4.0 + + 仮の戻り値の型が、DateTime になりました。 + これより前のバージョンでは、 + DateTimefalse でした。 + + 8.3.0 diff --git a/reference/datetime/datetimeimmutable/modify.xml b/reference/datetime/datetimeimmutable/modify.xml index 36643cb3e9..eb301c21e2 100644 --- a/reference/datetime/datetimeimmutable/modify.xml +++ b/reference/datetime/datetimeimmutable/modify.xml @@ -1,6 +1,6 @@ - + @@ -12,7 +12,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::modify() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::modify stringmodifier @@ -62,6 +62,14 @@ + + 8.4.0 + + 仮の戻り値の型が、DateTimeImmutable になりました。 + これより前のバージョンでは、 + DateTimeImmutablefalse でした。 + + 8.3.0 From 78eda6204c9577b5a54fc6d5cccf564098e15c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Thu, 11 Jun 2026 16:02:26 +0900 Subject: [PATCH 4/4] =?UTF-8?q?isostr=20=E3=82=B7=E3=82=B0=E3=83=8D?= =?UTF-8?q?=E3=83=81=E3=83=A3=E3=81=AE=E9=9D=9E=E6=8E=A8=E5=A5=A8=E5=8C=96?= =?UTF-8?q?=E3=81=A8=20seealso=20=E3=81=B8=E3=81=AE=E3=83=A1=E3=82=BD?= =?UTF-8?q?=E3=83=83=E3=83=89=E8=BF=BD=E5=8A=A0=E3=82=92=E5=90=8C=E6=9C=9F?= =?UTF-8?q?=EF=BC=884=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原文: php/doc-en@9eb962113c および php/doc-en@726154e3c8 --- reference/datetime/dateperiod/construct.xml | 16 ++++++++++++---- reference/datetime/datetime/settimestamp.xml | 3 ++- .../datetime/datetimeimmutable/settimestamp.xml | 5 +++-- .../datetime/datetimeinterface/gettimestamp.xml | 3 ++- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/reference/datetime/dateperiod/construct.xml b/reference/datetime/dateperiod/construct.xml index 9da0cd3518..dd380a8820 100644 --- a/reference/datetime/dateperiod/construct.xml +++ b/reference/datetime/dateperiod/construct.xml @@ -1,6 +1,6 @@ - + @@ -35,9 +35,9 @@ intoptions0 - 代わりに、static なファクトリメソッド - DatePeriod::createFromISO8601String - を使いましょう。 + このコンストラクタのバリエーションは、PHP 8.4.0 以降は非推奨です。 + 代わりに DatePeriod::createFromISO8601String + を使ってください。 @@ -167,6 +167,14 @@ + + 8.4.0 + + isostr を使うシグネチャは非推奨となりました。 + 代わりに DatePeriod::createFromISO8601String + を使ってください。 + + 8.3.0 diff --git a/reference/datetime/datetime/settimestamp.xml b/reference/datetime/datetime/settimestamp.xml index 4817063a91..9c5afd477b 100644 --- a/reference/datetime/datetime/settimestamp.xml +++ b/reference/datetime/datetime/settimestamp.xml @@ -1,6 +1,6 @@ - + @@ -65,6 +65,7 @@ &reftitle.seealso; DateTimeImmutable::setTimestamp + DateTime::setMicrosecond diff --git a/reference/datetime/datetimeimmutable/settimestamp.xml b/reference/datetime/datetimeimmutable/settimestamp.xml index 03fdeb6da2..cd86da8bcf 100644 --- a/reference/datetime/datetimeimmutable/settimestamp.xml +++ b/reference/datetime/datetimeimmutable/settimestamp.xml @@ -1,6 +1,6 @@ - + @@ -12,7 +12,7 @@ &reftitle.description; - #[\NoDiscard] + #[\NoDiscard(message: "as DateTimeImmutable::setTimestamp() does not modify the object itself")] public DateTimeImmutableDateTimeImmutable::setTimestamp inttimestamp @@ -75,6 +75,7 @@ echo $newDate->format('U = Y-m-d H:i:s') . "\n"; &reftitle.seealso; DateTimeImmutable::getTimestamp + DateTimeImmutable::setMicrosecond diff --git a/reference/datetime/datetimeinterface/gettimestamp.xml b/reference/datetime/datetimeinterface/gettimestamp.xml index abab418b77..e161543f3a 100644 --- a/reference/datetime/datetimeinterface/gettimestamp.xml +++ b/reference/datetime/datetimeinterface/gettimestamp.xml @@ -1,6 +1,6 @@ - + @@ -157,6 +157,7 @@ echo $milli, "\n", $micro, "\n"; DateTime::setTimestamp DateTimeImmutable::setTimestamp DateTimeInterface::format + DateTimeInterface::getMicrosecond