Skip to content

Commit

Permalink
Fix date createFromTimestamp test (php#12766)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iluuu1994 authored Nov 24, 2023
1 parent fd3a865 commit f6efd12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/date/tests/createFromTimestamp.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f6efd12

Please sign in to comment.