3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result['years'] = []; $start = new \DateTime('2016-11-12'); $start->modify('monday this week'); $end = new \DateTime('2017-05-06'); $end->modify('monday next week'); $p = new \DatePeriod( $start, new \DateInterval('P1W'), $end ); foreach ($p as $d) { $y = $d->format("Y"); $m = $d->format("M"); if (!array_key_exists($y, $result['years'])){ $result['years'][$y] = ['y' => $y]; } if (!arrray_key_exists($d->format("m"), $result['years'][$y]['months'])){ $result['years'][$y]['months'][$d->format("m")] = ['m' => $m]; } $result['years'][$y]['months'][$m]['weeks'][] = ['f' => $d, 't' => (clone $d)->modify("sunday this week")]; //$result[$d->format("Y")][$d->format("M")][] = [$d, (clone $d)->modify("sunday this week")]; } print_r($result); exit; foreach ($result as $year => $months){ echo $year . PHP_EOL; foreach ($months as $month => $weeks){ echo "--" . $month . PHP_EOL; foreach ($weeks as $week){ echo "----" . $week[0]->format("jM") . "-" . $week[1]->format("jM") . PHP_EOL; } } } exit; $start = new DateTime('2010-12-02'); $start->modify('first day of this month'); $end = new DateTime('2012-05-06'); $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; $interval_1 = DateInterval::createFromDateString('1 week'); $end_1 = clone $dt; $end_1->add($interval); $period_1 = new DatePeriod($dt, $interval_1, $end_1); foreach ($period_1 as $dt_1){ echo "--" . $dt_1->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)
8.3.70.0110.00718.55
8.3.60.0070.01717.13
8.3.50.0070.01121.20
8.3.40.0040.01119.09
8.3.30.0040.01119.14
8.3.20.0030.00519.16
8.3.10.0060.00321.79
8.3.00.0080.00019.63
8.2.190.0110.00416.75
8.2.180.0210.00016.75
8.2.170.0040.01122.96
8.2.160.0070.01020.50
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00421.20
8.2.120.0060.00326.35
8.2.110.0050.00521.16
8.2.100.0060.00618.34
8.2.90.0040.00418.22
8.2.80.0080.00019.19
8.2.70.0090.00318.16
8.2.60.0030.00518.30
8.2.50.0050.00318.34
8.2.40.0000.00820.57
8.2.30.0000.00819.43
8.2.20.0040.00418.22
8.2.10.0000.00718.23
8.2.00.0030.00718.04
8.1.280.0040.01225.92
8.1.270.0060.00322.31
8.1.260.0070.00028.09
8.1.250.0070.00028.09
8.1.240.0090.00024.05
8.1.230.0040.00821.08
8.1.220.0080.00018.03
8.1.210.0050.00319.10
8.1.200.0030.00517.85
8.1.190.0060.00617.73
8.1.180.0000.00818.10
8.1.170.0050.00518.84
8.1.160.0000.00820.80
8.1.150.0040.00420.40
8.1.140.0040.00419.81
8.1.130.0000.00817.95
8.1.120.0040.00417.87
8.1.110.0040.00417.82
8.1.100.0040.00417.85
8.1.90.0070.00017.82
8.1.80.0040.00417.80
8.1.70.0000.00717.68
8.1.60.0040.00417.85
8.1.50.0030.00617.75
8.1.40.0040.00417.63
8.1.30.0000.00917.84
8.1.20.0070.00317.92
8.1.10.0040.00417.74
8.1.00.0070.00017.87
8.0.300.0050.00320.35
8.0.290.0030.00617.00
8.0.280.0000.00718.64
8.0.270.0030.00317.50
8.0.260.0000.00717.50
8.0.250.0000.01017.34
8.0.240.0000.00817.39
8.0.230.0070.00017.27
8.0.220.0040.00417.29
8.0.210.0030.00517.30
8.0.200.0070.00017.35
8.0.190.0030.00717.21
8.0.180.0000.00717.29
8.0.170.0000.00717.20
8.0.160.0000.00717.34
8.0.150.0070.00017.16
8.0.140.0040.00417.28
8.0.130.0060.00013.62
8.0.120.0000.00817.21
8.0.110.0000.00717.17
8.0.100.0040.00417.32
8.0.90.0030.00517.28
8.0.80.0090.00617.21
8.0.70.0000.00817.25
8.0.60.0050.00217.14
8.0.50.0000.00717.29
8.0.30.0090.00917.49
8.0.20.0110.01117.47
8.0.10.0040.00417.35
8.0.00.0140.00416.92
7.4.330.0030.00315.55
7.4.320.0030.00316.80
7.4.300.0000.00616.79
7.4.290.0000.00716.85
7.4.280.0050.00316.87
7.4.270.0030.00316.79
7.4.260.0000.00716.71
7.4.250.0040.00416.80
7.4.240.0030.00316.88
7.4.230.0040.00416.98
7.4.220.0110.00716.73
7.4.210.0080.00816.76
7.4.200.0030.00516.87
7.4.160.0080.01016.78
7.4.150.0130.00917.40
7.4.140.0080.01017.86
7.4.130.0100.00816.93
7.4.120.0090.00916.84
7.4.110.0070.01016.77
7.4.100.0070.01016.83
7.4.90.0100.00716.75
7.4.80.0080.01019.39
7.4.70.0050.01116.77
7.4.60.0090.00616.89
7.4.50.0040.01116.80
7.4.40.0160.00816.96
7.4.30.0130.00316.87
7.4.00.0090.00915.23
7.3.330.0060.00313.51
7.3.320.0050.00013.56
7.3.310.0040.00416.73
7.3.300.0060.00316.69
7.3.290.0000.00716.61
7.3.280.0100.00716.66
7.3.270.0200.00317.40
7.3.260.0030.01516.84
7.3.250.0140.00616.66
7.3.240.0120.00816.77
7.3.230.0180.00416.81
7.3.210.0000.01716.85
7.3.200.0100.00716.93
7.3.190.0090.00916.64
7.3.180.0110.01116.89
7.3.170.0070.01016.94
7.3.160.0120.00616.88
7.2.330.0120.00617.11
7.2.320.0100.01016.96
7.2.310.0030.01416.99
7.2.300.0070.01717.07
7.2.290.0120.00916.89
7.2.60.0140.00717.25
7.2.50.0070.00717.39
7.2.00.0070.00719.50
7.1.200.0080.00316.04
7.1.70.0040.00717.47
7.1.60.0070.00717.46
7.1.50.0030.01717.28
7.1.00.0030.07322.28
7.0.200.0040.00816.71
7.0.130.0100.06022.19
7.0.120.0070.05322.07
7.0.110.0100.08022.11
7.0.100.0100.06021.96
7.0.90.0030.06322.12
7.0.80.0130.05322.02
7.0.70.0100.05321.98
7.0.60.0030.06022.12
7.0.50.0100.05722.13
7.0.40.0070.05722.03
7.0.30.0130.05022.12
7.0.20.0070.06022.11
7.0.10.0070.05722.06
7.0.00.0100.05722.12
5.6.280.0200.04321.13
5.6.270.0170.07021.12
5.6.260.0000.06021.07
5.6.250.0100.05321.02
5.6.240.0030.06021.01
5.6.230.0130.05020.76
5.6.220.0070.06021.01
5.6.210.0100.05320.97
5.6.200.0130.05721.02
5.6.190.0100.05321.01
5.6.180.0030.06020.88
5.6.170.0070.05721.02
5.6.160.0070.06021.03
5.6.150.0070.06021.04
5.6.140.0130.07320.94
5.6.130.0070.05720.89
5.6.120.0000.06720.95
5.6.110.0030.06720.85
5.6.100.0030.06021.04
5.6.90.0030.06020.89
5.6.80.0000.05720.41
5.6.70.0070.06720.27
5.6.60.0030.05720.24
5.6.50.0170.04320.23
5.6.40.0030.05320.39
5.6.30.0030.05720.38
5.6.20.0130.05020.38
5.6.10.0000.06320.36
5.6.00.0100.05020.18

preferences:
59.99 ms | 401 KiB | 5 Q