3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); $time=-62167046400; // 0000-01-03 0-01-1 var_dump(date('Y-m-d o-W-N', $time - 86400)); var_dump(date('Y-m-d o-W-N', $time - 86400 * 2)); var_dump(date('Y-m-d o-W-N', $time - 86400 * 3), 'The issue appeared here. Expected: 0000-01-02 -1-52-5'); var_dump(date('Y-m-d o-W-N', $time - 86400 * 4)); var_dump(date('Y-m-d o-W-N', $time - 86400 * 5));

preferences:
53.34 ms | 402 KiB | 5 Q