3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link https://stackoverflow.com/a/13129856/367456 */ $formats = array( 'today midnight', 'midnight', 'today', 'TODAY', 'MidNight', 'ToDaY', 'tomorrow', 'UTC today', 'today Z', 'today Europe/Berlin', 'Asia/Shanghai today', 'Asia/Shanghai', 'HKST today', ); /** * give each time (unix timestamp) its own color * * @param $time * @return string */ function time_color($time) { static $colors = array('black', 'copper', 'blue', 'lime', 'green', 'pink', 'red'); static $coloredTime = array(-1 => ' ?! '); if (!isset($coloredTime[$time])) { $coloredTime[$time] = array_pop($colors); } return $coloredTime[$time]; } $time = strtotime('UTC 2020-01-01 00:00:00'); $format1 = "(default time-zone is ..: %s)\n"; if (is_callable('date_default_timezone_get')) { printf($format1, date_default_timezone_get()); } else { printf($format1, '??? (unknown)'); } printf("UTC time is ............: [%-6s] %d (script-time, UTC 2020-01-01 00:00:00)\n", time_color($time), $time); foreach ($formats as $format) { $strToTime = strtotime($format, $time); printf("%'.-24s: [%-6s] %d\n", "$format ", time_color($strToTime), $strToTime); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.10.0170.00018.84
8.3.140.0080.00016.85
8.3.130.0030.00616.82
8.3.120.0100.01020.60
8.3.110.0040.01220.94
8.3.100.0200.00927.15
8.3.90.0200.00832.15
8.3.80.0190.00727.14
8.3.70.0320.00823.62
8.3.60.0310.00823.68
8.3.50.0210.00723.56
8.3.40.0230.00724.75
8.3.30.0240.00724.72
8.3.20.0210.00826.44
8.3.10.0220.00726.61
8.3.00.0210.00827.06
8.2.250.0040.00418.70
8.2.240.0090.00317.44
8.2.230.0080.00022.58
8.2.220.0140.00737.54
8.2.210.0220.00632.15
8.2.200.0240.00327.08
8.2.190.0240.00621.20
8.2.180.0220.01126.74
8.2.170.0240.01224.81
8.2.160.0280.00426.08
8.2.150.0200.00526.98
8.2.140.0190.00326.65
8.2.130.0160.00227.06
8.2.120.0140.00425.38
8.2.110.0200.00324.03
8.2.100.0180.00523.03
8.2.90.0130.00623.23
8.2.80.0120.00722.95
8.2.70.0100.00923.14
8.2.60.0190.00723.04
8.2.50.0110.00621.89
8.2.40.0170.00723.12
8.2.30.0170.00623.53
8.2.20.0140.00621.52
8.2.10.0170.00722.33
8.2.00.0140.00721.62
8.1.300.0040.01116.71
8.1.290.0200.00628.21
8.1.280.0250.00926.68
8.1.270.0220.01026.60
8.1.260.0190.01227.04
8.1.250.0200.00427.71
8.1.240.0130.00622.73
8.1.230.0150.00722.76
8.1.220.0150.00322.94
8.1.210.0180.00623.40
8.1.200.0160.00922.90
8.1.190.0160.00622.83
8.1.180.0160.00722.88
8.1.170.0170.00322.90
8.1.160.0120.01023.24
8.1.150.0150.00923.16
8.1.140.0150.00521.77
8.1.130.0120.00521.79
8.1.120.0130.00521.79
8.1.110.0140.00421.84
8.1.100.0170.00221.85
8.1.90.0130.00521.85
8.1.80.0120.00521.17
8.1.70.0110.00621.08
8.1.60.0130.00420.71
8.1.50.0130.00520.63
8.1.40.0130.00819.99
8.1.30.0180.00620.74
8.1.20.0150.00720.07
8.1.10.0140.00720.67
8.1.00.0180.00420.63
8.0.300.0200.00323.09
8.0.290.0180.00622.36
8.0.280.0190.00322.71
8.0.270.0120.00822.30
8.0.260.0110.00521.63
8.0.250.0110.00621.30
8.0.240.0120.00421.31
8.0.230.0100.00521.38
8.0.220.0100.00521.29
8.0.210.0130.00620.60
8.0.200.0120.00720.62
8.0.190.0140.00620.16
8.0.180.0120.00720.15
8.0.170.0140.00620.12
8.0.160.0130.00620.12
8.0.150.0130.00520.11
8.0.140.0130.00620.08
8.0.130.0120.00519.24
8.0.120.0120.00619.03
8.0.110.0130.00519.04
8.0.100.0110.00518.64
8.0.90.0130.00518.99
8.0.80.0150.00319.04
8.0.70.0120.00619.01
8.0.60.0130.00519.00
8.0.50.0140.00519.06
8.0.30.0100.00819.00
8.0.20.0120.00719.02
8.0.10.0090.00619.12
8.0.00.0100.00419.18
7.4.330.0100.00318.88
7.4.320.0070.00921.01
7.4.300.0090.00418.86
7.4.290.0090.00719.74
7.4.280.0140.00319.86
7.4.270.0130.00419.77
7.4.260.0110.00519.00
7.4.250.0120.00418.75
7.4.240.0090.00518.74
7.4.230.0110.00518.72
7.4.220.0140.00518.74
7.4.210.0100.00518.76
7.4.200.0110.00718.77
7.4.190.0090.00918.77
7.4.180.0140.00418.81
7.4.160.0150.00418.83
7.4.150.0120.00418.71
7.4.140.0120.00418.71
7.4.130.0120.00718.71
7.4.120.0140.00418.75
7.4.110.0130.00518.66
7.4.100.0130.00418.79
7.4.90.0130.00418.74
7.4.80.0130.00518.74
7.4.70.0140.00418.73
7.4.60.0110.00518.69
7.4.50.0150.00318.64
7.4.40.0140.00418.60
7.4.30.0130.00418.70
7.4.20.0120.00618.67
7.4.10.0160.00218.69
7.4.00.0130.00518.72
7.3.330.0130.00619.31
7.3.320.0120.00618.32
7.3.310.0160.00418.69
7.3.300.0130.00518.71
7.3.290.0140.00418.67
7.3.280.0140.00518.68
7.3.270.0140.00418.71
7.3.260.0150.00518.68
7.3.250.0140.00518.73
7.3.240.0140.00418.64
7.3.230.0140.00518.66
7.3.220.0160.00418.62
7.3.210.0160.00518.64
7.3.200.0150.00518.61
7.3.190.0130.00518.56
7.3.180.0140.00518.66
7.3.170.0140.00618.65
7.3.160.0120.00618.58
7.3.150.0140.00418.53
7.3.140.0140.00518.61
7.3.130.0160.00418.63
7.3.120.0150.00318.62
7.3.110.0150.00418.61
7.3.100.0150.00418.56
7.3.90.0150.00518.77
7.3.80.0140.00518.57
7.3.70.0140.00718.68
7.3.60.0150.00518.73
7.3.50.0160.00518.71
7.3.40.0140.00718.75
7.3.30.0160.00518.69
7.3.20.0190.00520.09
7.3.10.0130.00620.05
7.3.00.0130.00520.04

preferences:
38.75 ms | 403 KiB | 5 Q