From f6efd126a5df82b2c20142f999f12d7bce18ce16 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 24 Nov 2023 14:24:32 +0100 Subject: [PATCH] Fix date createFromTimestamp test (#12766) Unfortuantely, PHP_INT_MIN cannot be expressed as a literal in PHP, because -NUM is parsed as (-)(NUM). NUM is restricted to PHP_INT_MAX. --- ext/date/tests/createFromTimestamp.phpt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/date/tests/createFromTimestamp.phpt b/ext/date/tests/createFromTimestamp.phpt index 7e27e19941b..9eefc79303d 100644 --- a/ext/date/tests/createFromTimestamp.phpt +++ b/ext/date/tests/createFromTimestamp.phpt @@ -9,7 +9,8 @@ class MyDateTime extends DateTime {}; class MyDateTimeImmutable extends DateTimeImmutable {}; define('MAX_32BIT', 2147483647); -define('MIN_32BIT', -2147483648); +// -2147483648 may not be expressed in a literal due to parsing peculiarities. +define('MIN_32BIT', -2147483647 - 1); $timestamps = array( 1696883232,