3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $a[0] = get_cfg_var('date.timezone'); $a[1] = ini_get('date.timezone'); $a[2] = time(); // GMT/UTC $a[3] = 1610229269; // 21-01-09 21:54:29 GMT/UTC $a[4] = date('y-m-d H:i:s e T', $a[2]); $a[5] = substr($a[4], 0, 17); $a[6] = date('y-m-d H:i:s e T', strtotime($a[5], $a[2])); $a[7] = date_default_timezone_get(); date_default_timezone_set('UTC'); $a[8] = date('y-m-d H:i:s e T', $a[2]); var_dump(date('y-m-d H:i:s', $a[3]) == '21-01-09 21:54:29', $a[4] == $a[6], $a );
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.26, 7.4.0 - 7.4.14, 8.0.0
bool(true) bool(true) array(9) { [0]=> string(16) "Europe/Amsterdam" [1]=> string(16) "Europe/Amsterdam" [2]=> int(1610232400) [3]=> int(1610229269) [4]=> string(38) "21-01-09 23:46:40 Europe/Amsterdam CET" [5]=> string(17) "21-01-09 23:46:40" [6]=> string(38) "21-01-09 23:46:40 Europe/Amsterdam CET" [7]=> string(16) "Europe/Amsterdam" [8]=> string(25) "21-01-09 22:46:40 UTC UTC" }
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_get() in /in/0enPY on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_get() in /in/0enPY on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_get() in /in/0enPY on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_get() in /in/0enPY on line 11

preferences:
215.48 ms | 401 KiB | 360 Q