Why, after 2039 not correctly sort dates?

Why, after 2039 not correctly sort dates? I enter the date and a message in input and write to the file then read the file and sort by date, if you enter dates up to 2039, all right,but since he somehow believes is not correct. Date that after 2039 is written to the beginning of the file, as if they are the smallest.
<?php
$message = $_POST['message'];
$date = $_POST['date'];
$arr2 = [];
if (isset($_POST['go'])) { 
 $file = fopen("new.txt",'a+t');
fwrite($file,"$date\n$message\n");
 fclose($file); 
 $arr = file ("new.txt");
 $newarr = array_chunk($arr,2); 

 function cmp($a, $b) 
{

 if ($a["0"] == $b["0"]) {
 return 0;
}
 return (strtotime($a["0"]) < strtotime($b["0"])) ? -1 : 1;
}
usort($newarr, "cmp");

 $f = fopen("two.txt",'w+t');
 for($z = 0; $z < count($newarr);$z++){ 
 fwrite($f,$newarr[$z][0]); 
 fwrite($f,$newarr[$z][1]); 
}
fclose($f);
}
?>
March 12th 20 at 08:09
1 answer
March 12th 20 at 08:11
Solution

PHP_INT_MAX (integer)
The maximum integer supported by this build of PHP. Usually, this is int(2147483647) on 32-bit systems and int(9223372036854775807) on 64-bit. Available since PHP 5.0.5 Usually PHP_INT_MIN === ~PHP_INT_MAX.

Most likely when converting numbers timstamp rests on the upper border
make
var_dump(PHP_INT_MAX);

Find more questions by tags PHP