3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!class_exists('DateTime')) { die('DateTime not available yet'); } echo 'Time zone database: ' . timezone_version_get() . PHP_EOL; echo PHP_EOL; date_default_timezone_set('Europe/Madrid'); $start = new DateTime('2017-03-26 01:59:00'); $increments = array( '+2 minutes' => '2017-03-26 03:01:00', '+2 hours' => '2017-03-26 04:59:00', ); echo 'Start: ' . $start->format('r') . PHP_EOL; foreach ($increments as $increment => $expected_string) { echo '>>> ' . $increment . PHP_EOL; $expected_end = new DateTime($expected_string); $actual_end = clone $start; $actual_end->modify($increment); echo 'Expected end: ' . $expected_end->format('r') . PHP_EOL; echo 'Actual end: ' . $actual_end->format('r') . PHP_EOL; echo ($expected_end->format('c')===$actual_end->format('c') ? 'OK' : 'ERROR') . PHP_EOL; echo PHP_EOL; }

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)
7.2.00.0030.00919.69
7.1.70.0030.00817.36
7.1.60.0040.00717.57
7.1.50.0070.01717.30
7.1.30.2180.06036.44
7.1.20.2270.08336.50
7.1.10.2730.06720.44
7.1.00.2330.07020.54
7.0.200.0100.00717.11
7.0.170.2070.05020.08
7.0.160.2230.06320.04
7.0.150.2530.07320.14
7.0.140.2630.09020.04
7.0.130.2670.07720.04
7.0.120.2400.06720.07
7.0.110.2370.08020.05
7.0.100.2300.06019.97
7.0.90.1700.07020.08
7.0.80.1800.06320.03
7.0.70.1600.07020.07
7.0.60.1600.07019.96
7.0.50.1530.06720.11
7.0.40.1500.06019.92
7.0.30.2070.08020.02
7.0.20.1600.07320.08
7.0.10.1500.05020.07
7.0.00.1630.06320.03
5.6.300.0070.07020.59
5.6.290.0100.06320.62
5.6.280.0200.07020.65
5.6.270.0170.07720.80
5.6.260.0170.06020.91
5.6.250.0230.06020.88
5.6.240.0070.07320.72
5.6.230.0130.07020.81
5.6.220.0200.06020.66
5.6.210.0070.08020.71
5.6.200.0130.06020.72
5.6.190.0130.06320.64
5.6.180.0070.08020.75
5.6.170.0200.06320.79
5.6.160.0130.07720.87
5.6.150.0230.06020.80
5.6.140.0330.06720.58
5.6.130.0130.08020.74
5.6.120.0200.06320.75
5.6.110.0170.07320.76
5.6.100.0200.08020.84
5.6.90.0130.07320.77
5.6.80.0070.06720.13
5.6.70.0200.06320.18
5.6.60.0170.07720.00
5.6.50.0170.06319.98
5.6.40.0170.05720.13
5.6.30.0130.08319.99
5.6.20.0130.07319.95
5.6.10.0470.05720.10
5.6.00.0000.07019.96
5.5.380.0070.07317.45
5.5.370.0230.06017.35
5.5.360.0130.06317.23
5.5.350.0200.05017.38
5.5.340.0130.05317.86
5.5.330.0170.05318.09
5.5.320.0200.05317.83
5.5.310.0030.06717.89
5.5.300.0170.07717.75
5.5.290.0200.06017.80
5.5.280.0200.06718.09
5.5.270.0230.06017.88
5.5.260.0130.07017.81
5.5.250.0200.06717.42
5.5.240.0100.06017.00
5.5.230.0170.06717.46
5.5.220.0070.06017.20
5.5.210.0070.08017.18
5.5.200.0170.05017.12
5.5.190.0030.06717.12
5.5.180.0100.06017.11
5.5.160.0170.05717.24
5.5.150.0070.07317.16
5.5.140.0100.07017.43
5.5.130.0170.06317.23
5.5.120.0200.04716.99
5.5.110.0170.05017.11
5.5.100.0070.07016.93
5.5.90.0230.04717.14
5.5.80.0130.06716.90
5.5.70.0230.05017.14
5.5.60.0100.07316.84
5.5.50.0030.06017.24
5.5.40.0130.06316.89
5.5.30.0030.06016.81
5.5.20.0100.08017.09
5.5.10.0200.04317.09
5.5.00.0030.07016.84
5.4.450.0130.07319.36
5.4.440.0130.07019.12
5.4.430.0070.08019.36
5.4.420.0200.06719.07
5.4.410.0200.06719.13
5.4.400.0270.05318.78
5.4.390.0100.07318.71
5.4.380.0100.05718.89
5.4.370.0100.05718.89
5.4.360.0170.06718.94
5.4.350.0070.08319.01
5.4.340.0100.05718.66
5.4.320.0100.06318.73
5.4.310.0170.06718.78
5.4.300.0200.06318.78
5.4.290.0170.06718.75
5.4.280.0200.06018.63
5.4.270.0230.05718.84
5.4.260.0270.05018.84
5.4.250.0130.05318.89
5.4.240.0100.07318.79
5.4.230.0230.05718.88
5.4.220.0100.05718.70
5.4.210.0170.06718.99
5.4.200.0070.05718.77
5.4.190.0170.05318.64
5.4.180.0170.07318.78
5.4.170.0330.04718.92
5.4.160.0170.07018.98
5.4.150.0130.07318.88
5.4.140.0100.06016.54
5.4.130.0100.05016.31
5.4.120.0070.07316.31
5.4.110.0070.06016.47
5.4.100.0130.06316.55
5.4.90.0070.05016.45
5.4.80.0130.04316.54
5.4.70.0100.05016.56
5.4.60.0200.04016.32
5.4.50.0170.05016.32
5.4.40.0100.05716.37
5.4.30.0170.05716.39
5.4.20.0070.05716.20
5.4.10.0100.05716.28
5.4.00.0070.04715.70
5.3.290.0070.07714.72
5.3.280.0070.07714.30
5.3.270.0170.04714.39
5.3.260.0030.08314.31
5.3.250.0130.06014.50
5.3.240.0100.06314.45
5.3.230.0170.04314.38
5.3.220.0130.05714.49
5.3.210.0130.08014.58
5.3.200.0100.04714.42
5.3.190.0130.05314.43
5.3.180.0030.05714.45
5.3.170.0100.04714.57
5.3.160.0000.05314.59
5.3.150.0030.07014.45
5.3.140.0100.06014.61
5.3.130.0100.05714.43
5.3.120.0000.06314.43
5.3.110.0000.07014.48
5.3.100.0070.05313.90
5.3.90.0170.04013.89
5.3.80.0100.05014.09
5.3.70.0100.05014.18
5.3.60.0030.06713.71
5.3.50.0100.05713.82
5.3.40.0130.05313.96
5.3.30.0170.06313.84
5.3.20.0030.06313.85
5.3.10.0170.05313.68
5.3.00.0100.05313.59
5.2.170.0100.05711.07
5.2.160.0030.04311.25
5.2.150.0030.06311.06
5.2.140.0030.06311.16
5.2.130.0070.05711.22
5.2.120.0070.04011.01
5.2.110.0100.05010.95
5.2.100.0070.05711.03
5.2.90.0030.06011.22
5.2.80.0070.04711.01
5.2.70.0100.05011.08
5.2.60.0000.06310.96
5.2.50.0170.04010.95
5.2.40.0070.05011.16
5.2.30.0100.04311.00
5.2.20.0000.04710.99
5.2.10.0100.04010.63
5.2.00.0070.05710.82
5.1.60.0030.04310.04
5.1.50.0100.0309.86
5.1.40.0030.04710.05
5.1.30.0100.05010.42
5.1.20.0030.04010.43
5.1.10.0070.03710.14
5.1.00.0170.02710.16
5.0.50.0000.0478.47
5.0.40.0070.0378.31
5.0.30.0200.0538.09
5.0.20.0030.0338.35
5.0.10.0070.0278.02
5.0.00.0030.0538.26
4.4.90.0000.0306.80
4.4.80.0070.0306.80
4.4.70.0070.0236.80
4.4.60.0030.0276.80
4.4.50.0030.0276.80
4.4.40.0030.0336.80
4.4.30.0070.0176.80
4.4.20.0030.0236.80
4.4.10.0030.0306.80
4.4.00.0000.0406.80
4.3.110.0070.0276.80
4.3.100.0000.0276.80
4.3.90.0170.0276.80
4.3.80.0030.0436.80
4.3.70.0100.0236.80
4.3.60.0030.0206.80
4.3.50.0030.0236.80
4.3.40.0030.0376.80
4.3.30.0000.0306.80
4.3.20.0100.0206.80
4.3.10.0030.0276.80
4.3.00.0030.0276.80

preferences:
28.57 ms | 401 KiB | 5 Q