3v4l.org

run code in 300+ PHP versions simultaneously
<?php $epoch = "1394031420"; $newepoch = time(); $dt = new DateTime("@$epoch"); // convert UNIX timestamp to PHP DateTime $newdt = new DateTime("@$newepoch"); // convert UNIX timestamp to PHP DateTime $start = new DateTime("@$epoch"); $start->modify('first day of this month'); $end = new DateTime("@$newepoch"); $end->modify('first day of next month'); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { echo $dt->format("Y-m") . 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.4.00.0070.01314.98
7.3.120.0070.01015.10
7.3.110.0110.00515.15
7.3.100.0050.01015.07
7.3.90.0030.01215.15
7.3.80.0030.01015.07
7.3.70.0040.01115.04
7.3.60.0050.00715.03
7.3.50.0060.00614.96
7.3.40.0070.00715.03
7.3.30.0020.01015.06
7.3.20.0080.00316.74
7.3.10.0060.00916.82
7.3.00.0070.01016.90
7.2.250.0060.01215.53
7.2.240.0110.00615.41
7.2.230.0070.01215.31
7.2.220.0000.01615.31
7.2.210.0110.00215.27
7.2.200.0050.00715.31
7.2.190.0020.01215.39
7.2.180.0100.00415.18
7.2.170.0020.01115.37
7.2.160.0070.00715.29
7.2.150.0030.01016.93
7.2.140.0100.00717.16
7.2.130.0070.00517.11
7.2.120.0090.00617.17
7.2.110.0050.00817.28
7.2.100.0070.00517.28
7.2.90.0030.01217.24
7.2.80.0080.00817.15
7.2.70.0070.00916.99
7.2.60.0080.00816.97
7.2.50.0090.00417.04
7.2.40.0060.00817.26
7.2.30.0050.01017.16
7.2.20.0050.00917.16
7.2.10.0050.01317.10
7.2.00.0080.00618.06
7.1.330.0070.00815.89
7.1.320.0060.01016.07
7.1.310.0030.01016.03
7.1.300.0030.01016.03
7.1.290.0020.01116.15
7.1.280.0050.00816.09
7.1.270.0070.00516.09
7.1.260.0090.00416.09
7.1.250.0040.00915.70
7.1.100.0080.00318.15
7.1.70.0000.01117.55
7.1.60.0030.02119.70
7.1.50.0140.00717.27
7.1.00.0030.07722.55
7.0.200.0000.00716.88
7.0.140.0030.07322.07
7.0.80.0130.03719.95
7.0.70.0070.04019.92
7.0.60.0270.06719.97
7.0.50.0100.03720.27
7.0.40.0100.08320.04
7.0.30.0070.04720.14
7.0.20.0000.06020.04
7.0.10.0100.04720.10
7.0.00.0070.08020.07
5.6.280.0100.07020.80
5.6.230.0000.04020.50
5.6.220.0070.03720.64
5.6.210.0000.04320.48
5.6.200.0030.07721.02
5.6.190.0000.05021.13
5.6.180.0000.07721.04
5.6.170.0130.08321.02
5.6.160.0070.04721.11
5.6.150.0070.08720.95
5.6.140.0070.06720.98
5.6.130.0130.07021.08
5.6.120.0100.08021.00
5.6.110.0070.08020.95
5.6.100.0070.08320.93
5.6.90.0000.09020.98
5.6.80.0100.05020.46
5.6.70.0170.07320.33
5.6.60.0170.05720.44
5.6.50.0030.07320.46
5.6.40.0100.07020.42
5.6.30.0070.07720.53
5.6.20.0100.05020.37
5.6.10.0000.08020.44
5.6.00.0070.04720.30
5.5.370.0070.03020.35
5.5.360.0030.07320.50
5.5.350.0030.03720.33
5.5.340.0100.06720.64
5.5.330.0030.07020.92
5.5.320.0070.08320.91
5.5.310.0200.06720.85
5.5.300.0170.07320.88
5.5.290.0130.06020.73
5.5.280.0100.08020.88
5.5.270.0130.05720.86
5.5.260.0100.07720.81
5.5.250.0170.06720.61
5.5.240.0100.06320.18
5.5.230.0130.04320.29
5.5.220.0130.07320.17
5.5.210.0030.05720.23
5.5.200.0270.07320.09
5.5.190.0070.07720.18
5.5.180.0000.07020.22
5.5.160.0100.07720.14
5.5.150.0070.06020.26
5.5.140.0100.08020.25
5.5.130.0100.07720.22
5.5.120.0070.05720.14
5.5.110.0130.07320.19
5.5.100.0100.07720.01
5.5.90.0130.07720.09
5.5.80.0100.07320.07
5.5.70.0100.07720.05
5.5.60.0070.07320.13
5.5.50.0000.08320.07
5.5.40.0030.05020.03
5.5.30.0130.07320.14
5.5.20.0070.07720.07
5.5.10.0100.08020.03
5.5.00.0130.06720.01
5.4.450.0070.05719.45
5.4.440.0100.08319.44
5.4.430.0070.04319.36
5.4.420.0130.08019.27
5.4.410.0100.07019.44
5.4.400.0130.03718.95
5.4.390.0030.05318.81
5.4.380.0130.05718.96
5.4.370.0000.08019.15
5.4.360.0070.08318.80
5.4.350.0070.07319.04
5.4.340.0170.06719.12
5.4.320.0130.06719.14
5.4.310.0070.07319.04
5.4.300.0130.07719.02
5.4.290.0100.07718.97
5.4.280.0030.05718.98
5.4.270.0100.07319.09
5.4.260.0170.06718.78
5.4.250.0100.07718.83
5.4.240.0100.05718.78
5.4.230.0030.05319.12
5.4.220.0070.08718.80
5.4.210.0130.07318.75
5.4.200.0100.07019.12
5.4.190.0130.05018.80
5.4.180.0170.07319.04
5.4.170.0070.05319.08
5.4.160.0070.08019.00
5.4.150.0070.08319.07
5.4.140.0030.04316.34
5.4.130.0030.07316.12
5.4.120.0100.03316.26
5.4.110.0030.08016.42
5.4.100.0070.07316.30
5.4.90.0100.06016.41
5.4.80.0030.06016.41
5.4.70.0070.06016.21
5.4.60.0130.06316.41
5.4.50.0170.06316.39
5.4.40.0070.03716.23
5.4.30.0000.04316.39
5.4.20.0070.05016.27
5.4.10.0030.07716.21
5.4.00.0070.08015.80
5.3.290.0100.07014.67
5.3.280.0070.04014.56
5.3.270.0070.07314.57
5.3.260.0070.06714.61
5.3.250.0130.03314.55
5.3.240.0100.06014.57
5.3.230.0100.06714.60
5.3.220.0030.05014.52
5.3.210.0100.07014.43
5.3.200.0070.07014.41
5.3.190.0000.08314.54
5.3.180.0030.06014.40
5.3.170.0070.06714.43
5.3.160.0100.04314.44
5.3.150.0070.05714.58
5.3.140.0030.05014.41
5.3.130.0100.07714.39
5.3.120.0100.07314.41
5.3.110.0100.06714.51
5.3.100.0070.07313.90
5.3.90.0100.08714.02
5.3.80.0070.07714.01
5.3.70.0130.07013.99
5.3.60.0070.07313.76
5.3.50.0070.07713.91
5.3.40.0130.05013.80
5.3.30.0100.05713.82
5.3.20.0000.04313.65
5.3.10.0100.05713.59
5.3.00.0100.06713.64
5.2.170.0030.05311.19
5.2.160.0070.06010.94
5.2.150.0030.04711.10
5.2.140.0070.03010.96
5.2.130.0030.06310.96
5.2.120.0070.05710.95
5.2.110.0070.06311.06
5.2.100.0030.06310.96
5.2.90.0070.02710.91
5.2.80.0000.04711.09
5.2.70.0030.05310.96
5.2.60.0070.05711.09
5.2.50.0070.06010.88
5.2.40.0070.03310.97
5.2.30.0000.06710.79
5.2.20.0070.06010.84
5.2.10.0070.05011.00
5.2.00.0100.05710.70
5.1.60.0030.04310.70
5.1.50.0070.05010.70
5.1.40.0030.02710.70
5.1.30.0070.05010.70
5.1.20.0100.06310.70
5.1.10.0030.04010.70
5.1.00.0100.05310.70
5.0.50.0030.04710.70
5.0.40.0030.05010.70
5.0.30.0100.06310.70
5.0.20.0100.04010.70
5.0.10.0030.04010.70
5.0.00.0030.06710.70
4.4.90.0030.03310.70
4.4.80.0000.03710.70
4.4.70.0030.03310.70
4.4.60.0000.01710.70
4.4.50.0000.03710.70
4.4.40.0030.03310.70
4.4.30.0000.02310.70
4.4.20.0030.03310.70
4.4.10.0000.03010.70
4.4.00.0000.04310.70
4.3.110.0100.02710.70
4.3.100.0070.02710.70
4.3.90.0070.03010.70
4.3.80.0030.05310.70
4.3.70.0000.02710.70
4.3.60.0000.03710.70
4.3.50.0030.02310.70
4.3.40.0000.05310.70
4.3.30.0000.03710.70
4.3.20.0000.02010.70
4.3.10.0000.04010.70
4.3.00.0000.02310.70

preferences:
37.16 ms | 401 KiB | 5 Q