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-d") . 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.0040.00819.73
7.1.100.0110.00018.44
7.1.70.0050.00217.15
7.1.60.0140.01019.70
7.1.50.0090.01217.22
7.1.00.0070.07322.44
7.0.200.0030.00716.79
7.0.140.0070.07022.07
7.0.100.0470.08320.02
7.0.90.0430.08019.94
7.0.80.0370.08320.02
7.0.70.0430.07020.02
7.0.60.0430.08019.80
7.0.50.0470.08020.38
7.0.40.0070.05320.09
7.0.30.0130.08020.04
7.0.20.0030.05019.95
7.0.10.0100.07320.12
7.0.00.0100.04720.04
5.6.280.0000.07320.95
5.6.250.0100.06320.59
5.6.240.0100.05020.50
5.6.230.0070.06720.57
5.6.220.0070.08020.67
5.6.210.0170.07720.68
5.6.200.0070.05021.07
5.6.190.0130.07321.08
5.6.180.0070.08721.17
5.6.170.0170.06320.98
5.6.160.0100.06320.93
5.6.150.0170.07321.03
5.6.140.0070.08320.95
5.6.130.0170.08020.94
5.6.120.0170.07721.07
5.6.110.0100.08721.13
5.6.100.0000.04721.02
5.6.90.0070.08720.96
5.6.80.0070.07320.34
5.6.70.0070.04720.39
5.6.60.0200.04320.52
5.6.50.0070.06720.40
5.6.40.0100.05720.44
5.6.30.0100.04020.33
5.6.20.0170.07320.37
5.6.10.0030.08720.36
5.6.00.0070.06320.39
5.5.380.0070.08320.35
5.5.370.0100.08020.39
5.5.360.0200.07020.44
5.5.350.0130.07320.38
5.5.340.0000.06320.79
5.5.330.0100.07720.82
5.5.320.0070.08320.91
5.5.310.0070.06020.88
5.5.300.0130.05020.91
5.5.290.0070.05720.91
5.5.280.0130.07320.90
5.5.270.0030.09020.79
5.5.260.0030.06020.89
5.5.250.0130.04720.54
5.5.240.0130.06720.16
5.5.230.0030.08720.24
5.5.220.0130.03720.17
5.5.210.0100.04720.17
5.5.200.0070.06320.25
5.5.190.0170.07020.14
5.5.180.0100.07320.13
5.5.160.0070.03720.25
5.5.150.0100.07720.27
5.5.140.0000.05320.17
5.5.130.0200.06719.98
5.5.120.0100.07320.21
5.5.110.0130.06720.18
5.5.100.0130.07720.10
5.5.90.0030.07720.05
5.5.80.0070.08320.06
5.5.70.0130.07320.14
5.5.60.0070.07720.14
5.5.50.0130.05720.05
5.5.40.0070.04019.95
5.5.30.0070.08020.09
5.5.20.0130.06720.07
5.5.10.0030.08720.08
5.5.00.0030.04719.95
5.4.450.0070.04719.27
5.4.440.0030.08719.42
5.4.430.0030.08019.46
5.4.420.0100.07319.44
5.4.410.0170.07019.16
5.4.400.0100.04018.81
5.4.390.0070.08018.96
5.4.380.0030.05718.98
5.4.370.0230.06018.96
5.4.360.0070.07318.80
5.4.350.0070.07319.05
5.4.340.0070.07319.11
5.4.320.0070.03718.81
5.4.310.0130.07319.04
5.4.300.0070.07319.11
5.4.290.0070.05319.11
5.4.280.0030.06318.77
5.4.270.0130.06719.09
5.4.260.0130.07019.09
5.4.250.0030.07319.03
5.4.240.0170.07318.78
5.4.230.0100.05718.77
5.4.220.0130.06319.14
5.4.210.0000.04319.02
5.4.200.0030.08019.05
5.4.190.0130.05719.04
5.4.180.0070.07719.11
5.4.170.0070.05019.02
5.4.160.0100.04019.12
5.4.150.0000.08018.93
5.4.140.0030.07316.12
5.4.130.0170.06016.34
5.4.120.0100.07316.32
5.4.110.0070.07316.36
5.4.100.0070.06716.21
5.4.90.0170.06316.41
5.4.80.0030.07316.42
5.4.70.0070.07716.20
5.4.60.0070.07316.41
5.4.50.0070.07316.39
5.4.40.0130.03016.43
5.4.30.0070.07316.35
5.4.20.0070.07016.18
5.4.10.0000.05016.18
5.4.00.0100.06715.77
5.3.290.0000.08014.52
5.3.280.0130.06714.59
5.3.270.0030.07314.43
5.3.260.0100.07014.52
5.3.250.0030.07314.55
5.3.240.0030.07714.60
5.3.230.0070.08014.60
5.3.220.0070.07314.58
5.3.210.0030.07714.54
5.3.200.0100.06714.56
5.3.190.0000.08014.57
5.3.180.0030.08014.53
5.3.170.0100.06714.42
5.3.160.0070.06714.53
5.3.150.0030.07314.53
5.3.140.0000.06714.54
5.3.130.0100.07714.50
5.3.120.0030.08314.41
5.3.110.0070.05714.41
5.3.100.0100.07014.03
5.3.90.0030.06013.96
5.3.80.0030.06713.88
5.3.70.0070.08013.93
5.3.60.0100.06013.87
5.3.50.0030.07713.71
5.3.40.0030.07713.89
5.3.30.0030.04713.88
5.3.20.0100.04013.65
5.3.10.0000.04013.62
5.3.00.0030.04013.62
5.2.170.0000.06711.16
5.2.160.0070.06011.10
5.2.150.0100.05711.10
5.2.140.0000.04711.16
5.2.130.0070.02311.18
5.2.120.0030.03011.10
5.2.110.0000.03311.03
5.2.100.0070.02711.15
5.2.90.0000.03011.14
5.2.80.0000.03711.07
5.2.70.0070.03011.11
5.2.60.0030.02711.06
5.2.50.0070.03010.87
5.2.40.0030.02710.87
5.2.30.0100.04011.01
5.2.20.0030.03011.04
5.2.10.0030.02310.84
5.2.00.0030.02710.84
5.1.60.0000.03010.84
5.1.50.0030.02310.84
5.1.40.0070.02710.84
5.1.30.0030.02310.84
5.1.20.0000.02710.84
5.1.10.0030.02710.84
5.1.00.0100.01310.84
5.0.50.0030.02010.84
5.0.40.0070.04010.84
5.0.30.0030.04310.84
5.0.20.0030.02010.84
5.0.10.0000.02010.84
5.0.00.0030.04710.84
4.4.90.0000.01710.84
4.4.80.0000.01710.84
4.4.70.0000.01710.84
4.4.60.0000.01710.84
4.4.50.0000.01710.84
4.4.40.0030.02010.84
4.4.30.0000.01710.84
4.4.20.0000.01710.84
4.4.10.0000.01710.84
4.4.00.0030.03710.84
4.3.110.0000.03010.84
4.3.100.0030.01010.84
4.3.90.0030.01310.84
4.3.80.0000.02710.84
4.3.70.0000.02010.84
4.3.60.0000.03010.84
4.3.50.0000.01710.84
4.3.40.0000.02710.84
4.3.30.0000.01310.84
4.3.20.0000.03310.84
4.3.10.0030.01310.84
4.3.00.0000.01710.84

preferences:
40.76 ms | 400 KiB | 5 Q