Skip to content

Commit 1838eab

Browse files
committed
Fix date createFromTimestamp test
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 d3c2673 commit 1838eab

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ext/date/tests/createFromTimestamp.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MyDateTime extends DateTime {};
99
class MyDateTimeImmutable extends DateTimeImmutable {};
1010

1111
define('MAX_32BIT', 2147483647);
12-
define('MIN_32BIT', -2147483648);
12+
define('MIN_32BIT', -2147483647);
1313

1414
$timestamps = array(
1515
1696883232,
@@ -223,33 +223,33 @@ DateTimeImmutable::createFromTimestamp(2147483647): object(DateTimeImmutable)#%d
223223
["timezone"]=>
224224
string(6) "+00:00"
225225
}
226-
DateTime::createFromTimestamp(-2147483648): object(DateTime)#%d (3) {
226+
DateTime::createFromTimestamp(-2147483647): object(DateTime)#%d (3) {
227227
["date"]=>
228-
string(26) "1901-12-13 20:45:52.000000"
228+
string(26) "1901-12-13 20:45:53.000000"
229229
["timezone_type"]=>
230230
int(1)
231231
["timezone"]=>
232232
string(6) "+00:00"
233233
}
234-
DateTimeImmutable::createFromTimestamp(-2147483648): object(DateTimeImmutable)#%d (3) {
234+
DateTimeImmutable::createFromTimestamp(-2147483647): object(DateTimeImmutable)#%d (3) {
235235
["date"]=>
236-
string(26) "1901-12-13 20:45:52.000000"
236+
string(26) "1901-12-13 20:45:53.000000"
237237
["timezone_type"]=>
238238
int(1)
239239
["timezone"]=>
240240
string(6) "+00:00"
241241
}
242-
DateTime::createFromTimestamp(-2147483648.5): object(DateTime)#%d (3) {
242+
DateTime::createFromTimestamp(-2147483647.5): object(DateTime)#%d (3) {
243243
["date"]=>
244-
string(26) "1901-12-13 20:45:51.500000"
244+
string(26) "1901-12-13 20:45:52.500000"
245245
["timezone_type"]=>
246246
int(1)
247247
["timezone"]=>
248248
string(6) "+00:00"
249249
}
250-
DateTimeImmutable::createFromTimestamp(-2147483648.5): object(DateTimeImmutable)#%d (3) {
250+
DateTimeImmutable::createFromTimestamp(-2147483647.5): object(DateTimeImmutable)#%d (3) {
251251
["date"]=>
252-
string(26) "1901-12-13 20:45:51.500000"
252+
string(26) "1901-12-13 20:45:52.500000"
253253
["timezone_type"]=>
254254
int(1)
255255
["timezone"]=>

0 commit comments

Comments
 (0)