Skip to content

Commit f6efd12

Browse files
authored
Fix date createFromTimestamp test (php#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.
1 parent fd3a865 commit f6efd12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/date/tests/createFromTimestamp.phpt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class MyDateTime extends DateTime {};
99
class MyDateTimeImmutable extends DateTimeImmutable {};
1010

1111
define('MAX_32BIT', 2147483647);
12-
define('MIN_32BIT', -2147483648);
12+
// -2147483648 may not be expressed in a literal due to parsing peculiarities.
13+
define('MIN_32BIT', -2147483647 - 1);
1314

1415
$timestamps = array(
1516
1696883232,

0 commit comments

Comments
 (0)