[PHP-CVS] [php-src] master: Update timelib to 2026.02

[email protected] (Derick Rethans)
Newsgroups php.cvs
Message-ID <[email protected]>
Author: Derick Rethans (derickr)
Date: 2026-08-06T16:58:19+01:00

Commit: https://github.com/php/php-src/commit/389d4a71e44843e18f7d6627567cbd940eaeb306
Raw diff: https://github.com/php/php-src/commit/389d4a71e44843e18f7d6627567cbd940eaeb306.diff

Update timelib to 2026.02

Changed paths:
  M  NEWS
  M  ext/date/lib/duration.c
  M  ext/date/lib/timelib.c
  M  ext/date/lib/timelib.h
  M  ext/date/lib/timelib_private.h


Diff:

diff --git a/NEWS b/NEWS
index a70b2d52d8b0..b6d2b227ce2f 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,7 @@ PHP                                                                        NEWS
     returns an unexpected long. (Sjoerd Langkemper)
 
 - Date:
-  . Update timelib to 2026.01. (Derick, timwolla)
+  . Update timelib to 2026.02. (Derick, timwolla)
 
 - GMP:
   . Added optional $definitely_prime output parameter to gmp_prevprime().
diff --git a/ext/date/lib/duration.c b/ext/date/lib/duration.c
index b5b0c7668504..b6626419b6b1 100644
--- a/ext/date/lib/duration.c
+++ b/ext/date/lib/duration.c
@@ -27,7 +27,7 @@
 
 int timelib_duration_ctor_static(
 	timelib_duration *duration,
-	timelib_ull       seconds,
+	uint64_t          seconds,
 	uint32_t          nanoseconds,
 	bool              negative
 ) {
@@ -51,7 +51,7 @@ int timelib_duration_ctor_static(
 }
 
 timelib_duration *timelib_duration_ctor(
-	timelib_ull            seconds,
+	uint64_t               seconds,
 	uint32_t               nanoseconds,
 	bool                   negative,
 	int                   *error_code
@@ -134,7 +134,7 @@ static int timelib_duration_add_abs_internal(
 	const timelib_duration *original,
 	const timelib_duration *additional
 ) {
-	timelib_ull seconds = original->seconds + additional->seconds;
+	uint64_t seconds = original->seconds + additional->seconds;
 	uint32_t nanoseconds = original->nanoseconds + additional->nanoseconds;
 
 	if (nanoseconds >= NSECS_PER_SEC) {
@@ -151,8 +151,8 @@ static int timelib_duration_sub_abs_internal(
 	const timelib_duration *original,
 	const timelib_duration *minus
 ) {
-	timelib_ull seconds = original->seconds - minus->seconds;
-	timelib_sll nanoseconds = (timelib_sll)original->nanoseconds - (timelib_sll)minus->nanoseconds;
+	uint64_t seconds = original->seconds - minus->seconds;
+	int32_t nanoseconds = (int32_t)original->nanoseconds - (int32_t)minus->nanoseconds;
 
 	if (nanoseconds < 0) {
 		seconds--;
@@ -343,8 +343,8 @@ int timelib_duration_div_static(
 	const timelib_duration *original,
 	uint64_t                divisor
 ) {
-	timelib_ull seconds;
-	uint32_t nanoseconds;
+	uint64_t seconds;
+	uint64_t nanoseconds;
 
 	if (divisor < 1) {
 		return TIMELIB_ERROR_DIVISION_BY_ZERO;
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 787e85334167..2bbc44a9219e 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -50,10 +50,10 @@ const char *timelib_error_messages[18] = {
 	"Nanoseconds value out of range",
 	"Division by zero",
 	"Integer Overflow",
-	"The ISO8601 duration string may only contain the period (P) aspect",
-	"The ISO8601 duration string is missing the perido (P) aspect",
-	"The ISO8601 duration string may only contain the time (T) aspect",
-	"The ISO8601 duration string could not be parsed",
+	"The ISO 8601 duration string may only contain the period (P) aspect",
+	"The ISO 8601 duration string is missing the period (P) aspect",
+	"The ISO 8601 duration string may only contain the time (T) aspect",
+	"The ISO 8601 duration string could not be parsed",
 };
 
 const char *timelib_get_error_message(int error_code)
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index 97f76f048d7b..87fefe1f2e2b 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -30,9 +30,9 @@
 # include "timelib_config.h"
 #endif
 
-#define TIMELIB_VERSION 202601
-#define TIMELIB_EXTENDED_VERSION 20260101
-#define TIMELIB_ASCII_VERSION "2026.01"
+#define TIMELIB_VERSION 202602
+#define TIMELIB_EXTENDED_VERSION 20260201
+#define TIMELIB_ASCII_VERSION "2026.02"
 
 #include <stdlib.h>
 #include <stdbool.h>
@@ -211,7 +211,7 @@ typedef struct _timelib_abbr_info {
 } timelib_abbr_info;
 
 typedef struct _timelib_duration {
-	timelib_ull  seconds;
+	uint64_t     seconds;
 	uint32_t     nanoseconds;
 	bool         negative;
 } timelib_duration;
@@ -1054,7 +1054,7 @@ void timelib_get_transitions_for_year(timelib_tzinfo *tz, timelib_sll year, time
  * *error_code set to a value from the TIMELIB_ERROR_* set.
  */
 timelib_duration *timelib_duration_ctor(
-	timelib_ull  seconds,
+	uint64_t     seconds,
 	uint32_t     nanoseconds,
 	bool         negative,
 	int         *error_code
@@ -1068,7 +1068,7 @@ timelib_duration *timelib_duration_ctor(
  */
 int timelib_duration_ctor_static(
 	timelib_duration *duration,
-	timelib_ull       seconds,
+	uint64_t          seconds,
 	uint32_t          nanoseconds,
 	bool              negative
 );
diff --git a/ext/date/lib/timelib_private.h b/ext/date/lib/timelib_private.h
index eece57421fd3..d54cff56ee42 100644
--- a/ext/date/lib/timelib_private.h
+++ b/ext/date/lib/timelib_private.h
@@ -87,8 +87,8 @@
 #define SECS_PER_DAY   86400
 #define SECS_PER_HOUR   3600
 #define USECS_PER_HOUR TIMELIB_LL_CONST(3600000000)
-#define NSECS_PER_SEC  TIMELIB_LL_CONST(1000000000)
-#define MAX_DURATION_SECONDS TIMELIB_LL_CONST(9223372035)
+#define NSECS_PER_SEC  1000000000
+#define MAX_DURATION_SECONDS UINT64_C(9223372035)
 
 #define DAYS_PER_WEEK      7
 #define DAYS_PER_YEAR    365
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.