I've stumbled upon this issue:
<?php
echo date('r', 4567743118);
Desired & correct result (on localhost):
Sun, 30 Sep 2114 10:31:58 +0100
Incorrect result (on remote):
Thu, 24 Aug 1978 04:03:42 +0100
The bad result is obtained when running the script on a 32bit platform. I think it's the famous Y2038 issue, but how should I fix it?
If I echo the timestamp (when stored in variable), it shows fine, but date()
destroys it (casting to int32, I assume).
<?php
$a = 4567743118;
echo $a;
4567743118
[if relevant, it's PHP 5.4.4 from debian repos]