3v4l.org

run code in 300+ PHP versions simultaneously
<?php $format = 'Y-m-d H:i:s'; // Using strtotime() function (Easiest) $time = strtotime('2016-09-03 14:55:24'); for ($x = 0; $x < 12; $x++) { $time = strtotime('+67 seconds', $time); echo date($format, $time) . "\n"; } echo "\n"; // Using DateTime objects, via the date_* functions $time = date_create('2016-09-03 14:55:24'); for ($x = 0; $x < 12; $x++) { date_add($time, date_interval_create_from_date_string('67 seconds')); echo date_format($time, $format) . "\n"; } echo "\n"; // Using DateTime objects, via Date* class methods $time = new DateTime('2016-09-03 14:55:24'); for ($x = 0; $x < 12; $x++) { $time->add(new DateInterval('PT67S')); echo $time->format($format) . "\n"; }

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.3.120.0050.00518.90
8.3.110.0060.00320.94
8.3.100.0050.00324.06
8.3.90.0070.00326.77
8.3.80.0090.00317.97
8.3.70.0090.00616.63
8.3.60.0170.01018.43
8.3.50.0080.01022.93
8.3.40.0070.00718.65
8.3.30.0040.01118.79
8.3.20.0000.00820.34
8.3.10.0000.00821.83
8.3.00.0080.00019.79
8.2.240.0030.00517.43
8.2.230.0030.00622.58
8.2.220.0070.01337.54
8.2.210.0000.00926.77
8.2.200.0030.00718.54
8.2.190.0070.01018.41
8.2.180.0150.00016.88
8.2.170.0100.00722.96
8.2.160.0100.00321.14
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0150.00322.25
8.2.120.0040.00426.35
8.2.110.0060.00321.11
8.2.100.0000.01218.34
8.2.90.0040.00419.25
8.2.80.0040.00417.97
8.2.70.0070.00317.75
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0040.00422.11
8.2.30.0050.00321.06
8.2.20.0050.00318.02
8.2.10.0040.00418.21
8.2.00.0040.00418.22
8.1.290.0060.00330.84
8.1.280.0150.00025.92
8.1.270.0080.00024.10
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0060.00322.32
8.1.230.0000.01117.89
8.1.220.0080.00017.91
8.1.210.0000.00818.77
8.1.200.0060.00317.60
8.1.190.0030.00617.47
8.1.180.0040.00418.10
8.1.170.0000.00818.75
8.1.160.0040.00422.22
8.1.150.0040.00419.00
8.1.140.0050.00219.71
8.1.130.0040.00417.84
8.1.120.0040.00417.73
8.1.110.0060.00317.69
8.1.100.0020.00517.71
8.1.90.0050.00517.71
8.1.80.0020.00517.64
8.1.70.0000.00717.73
8.1.60.0030.00717.78
8.1.50.0030.00617.67
8.1.40.0000.00817.74
8.1.30.0030.00517.93
8.1.20.0030.00617.77
8.1.10.0000.00917.71
8.1.00.0070.00417.68
8.0.300.0050.00318.77
8.0.290.0000.00716.75
8.0.280.0070.00018.61
8.0.270.0000.00717.41
8.0.260.0030.00317.41
8.0.250.0000.00817.30
8.0.240.0030.00317.25
8.0.230.0000.00717.13
8.0.220.0000.00717.20
8.0.210.0060.00317.18
8.0.200.0000.00617.29
8.0.190.0070.00017.10
8.0.180.0040.00417.10
8.0.170.0000.00817.16
8.0.160.0000.00717.24
8.0.150.0030.00517.11
8.0.140.0090.00017.13
8.0.130.0030.00313.53
8.0.120.0030.00617.03
8.0.110.0000.00817.06
8.0.100.0040.00417.19
8.0.90.0040.00417.12
8.0.80.0100.00717.20
8.0.70.0040.00417.21
8.0.60.0000.00816.96
8.0.50.0030.00517.13
8.0.30.0080.01017.31
8.0.20.0100.01117.40
8.0.10.0000.00717.11
8.0.00.0070.01417.00
7.4.330.0000.00515.10
7.4.320.0000.00616.71
7.4.300.0000.00616.75
7.4.290.0000.00716.64
7.4.280.0030.00616.72
7.4.270.0000.00816.59
7.4.260.0070.00016.63
7.4.250.0070.00016.63
7.4.240.0040.00416.75
7.4.230.0000.00716.49
7.4.220.0120.00816.79
7.4.210.0060.00916.71
7.4.200.0030.00316.73
7.4.160.0070.00916.73
7.4.150.0090.00917.40
7.4.140.0070.01417.86
7.4.130.0130.00716.74
7.4.120.0090.00816.50
7.4.110.0090.00916.71
7.4.100.0100.00716.48
7.4.90.0080.01116.47
7.4.80.0120.00619.39
7.4.70.0080.01216.70
7.4.60.0120.00516.86
7.4.50.0110.00316.84
7.4.40.0160.01016.60
7.4.30.0110.00616.74
7.4.00.0070.01015.24
7.3.330.0020.00413.23
7.3.320.0000.00613.23
7.3.310.0000.00816.35
7.3.300.0050.00316.52
7.3.290.0030.00316.43
7.3.280.0090.00916.48
7.3.270.0110.00617.40
7.3.260.0080.01016.78
7.3.250.0090.01016.61
7.3.240.0090.00916.66
7.3.230.0000.01716.71
7.3.210.0120.00916.51
7.3.200.0140.00316.58
7.3.190.0160.00016.44
7.3.180.0120.00616.49
7.3.170.0120.00916.65
7.3.160.0070.01016.62
7.3.10.0050.00916.67
7.3.00.0070.00716.68
7.2.330.0140.00716.91
7.2.320.0090.00916.99
7.2.310.0110.00716.78
7.2.300.0070.01716.89
7.2.290.0100.01316.74
7.2.130.0040.01116.99
7.2.120.0100.00616.97
7.2.110.0070.00817.04
7.2.100.0050.00916.98
7.2.90.0050.00917.03
7.2.80.0110.00817.10
7.2.70.0100.00617.13
7.2.60.0040.00917.12
7.2.50.0050.01017.08
7.2.40.0060.01017.00
7.2.30.0060.01017.13
7.2.20.0080.01217.05
7.2.10.0100.00817.06
7.2.00.0080.00617.83
7.1.250.0050.01216.06
7.1.200.0030.00716.14
7.1.70.0030.00517.51
7.1.60.0110.00719.75
7.1.00.0070.07322.28
7.0.200.0040.00716.95
7.0.90.0000.08021.61
7.0.80.0100.04721.59
7.0.70.0030.05021.65
7.0.60.0030.08321.71
7.0.50.0130.08322.06
7.0.40.0070.04720.09
7.0.30.0000.05719.94
7.0.20.0030.07319.99
7.0.10.0100.07720.12
7.0.00.0130.06720.05
5.6.240.0070.07020.63
5.6.230.0100.08020.49
5.6.220.0070.06320.52
5.6.210.0070.05020.64
5.6.200.0030.06320.99
5.6.190.0100.08321.03
5.6.180.0070.07021.13
5.6.170.0130.08321.02
5.6.160.0070.05020.97
5.6.150.0000.09321.13
5.6.140.0130.05020.99
5.6.130.0070.07721.09
5.6.120.0170.07321.12
5.6.110.0070.08021.02
5.6.100.0000.07720.96
5.6.90.0100.07721.10
5.6.80.0070.07720.46
5.6.70.0100.07720.37
5.6.60.0130.05020.35
5.6.50.0030.07720.42
5.6.40.0030.07720.34
5.6.30.0230.06020.41
5.6.20.0200.07020.41
5.6.10.0070.08320.38
5.6.00.0030.08020.31

preferences:
52.35 ms | 403 KiB | 5 Q