3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTimeImmutable('now'); $months = []; $monthcnt = 0; for ($i = 1; $i <= 12; $i++) { if (($i % 3) == 0) { $monthcnt += 3; $minus = '-' . $monthcnt . ' months'; $pq3 = $now->modify($minus); var_dump($pq3->format('m')); // switch ($pq3->format('m')) // case var_dump($pq3->format('Y')); } }

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.60.0180.00018.43
8.3.50.0160.00318.11
8.3.40.0120.00918.67
8.3.30.0070.00719.14
8.3.20.0080.00019.16
8.3.10.0040.00421.89
8.3.00.0000.00820.70
8.2.180.0110.01118.41
8.2.170.0140.00422.96
8.2.160.0040.01422.12
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00418.28
8.2.120.0080.00026.35
8.2.110.0000.01019.37
8.2.100.0040.00719.89
8.2.90.0000.00817.88
8.2.80.0060.00317.97
8.2.70.0050.00318.05
8.2.60.0030.00618.28
8.2.50.0000.00818.10
8.2.40.0070.00019.59
8.2.30.0040.00419.43
8.2.20.0050.00318.13
8.2.10.0040.00418.25
8.2.00.0030.00517.85
8.1.280.0070.00725.92
8.1.270.0050.00320.85
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0090.00022.53
8.1.230.0040.00822.26
8.1.220.0030.00517.90
8.1.210.0060.00318.77
8.1.200.0090.00017.63
8.1.190.0000.00817.63
8.1.180.0000.00818.10
8.1.170.0000.00918.77
8.1.160.0000.00719.13
8.1.150.0000.00719.07
8.1.140.0000.00722.20
8.1.130.0030.00320.25
8.1.120.0000.00717.74
8.1.110.0040.00417.73
8.1.100.0030.00617.61
8.1.90.0040.00417.70
8.1.80.0000.00817.69
8.1.70.0030.00317.72
8.1.60.0000.00817.68
8.1.50.0040.00417.70
8.1.40.0080.00017.59
8.1.30.0030.00517.80
8.1.20.0000.00717.81
8.1.10.0080.00017.84
8.1.00.0000.00817.78
8.0.300.0040.00418.77
8.0.290.0080.00017.00
8.0.280.0030.00318.54
8.0.270.0030.00317.39
8.0.260.0040.00418.61
8.0.250.0070.00217.20
8.0.240.0000.00717.22
8.0.230.0070.00017.23
8.0.220.0050.00517.01
8.0.210.0040.00417.15
8.0.200.0000.00617.20
8.0.190.0040.00417.20
8.0.180.0050.00317.15
8.0.170.0080.00017.05
8.0.160.0040.00417.11
8.0.150.0080.00016.97
8.0.140.0040.00417.02
8.0.130.0000.00613.47
8.0.120.0040.00417.02
8.0.110.0000.00717.09
8.0.100.0040.00417.09
8.0.90.0040.00417.08
8.0.80.0110.00717.12
8.0.70.0000.00816.97
8.0.60.0090.00017.05
8.0.50.0000.00717.15
8.0.30.0130.00817.32
8.0.20.0070.01217.41
8.0.10.0000.00717.26
8.0.00.0110.00816.87
7.4.330.0050.00015.55
7.4.320.0000.00716.78
7.4.300.0040.00416.73
7.4.290.0090.00016.69
7.4.280.0050.00516.65
7.4.270.0030.00316.78
7.4.260.0030.00616.75
7.4.250.0030.00316.65
7.4.240.0040.00416.66
7.4.230.0030.00316.70
7.4.220.0030.00516.86
7.4.210.0100.00416.80
7.4.200.0040.00416.66
7.4.160.0060.01216.70
7.4.140.0100.01017.86
7.4.130.0130.01016.74
7.4.120.0080.01016.74
7.4.110.0060.01616.72
7.4.100.0030.01316.88
7.4.90.0070.01116.69
7.4.80.0130.00919.39
7.4.70.0070.01016.83
7.4.60.0090.00616.62
7.4.50.0030.01216.63
7.4.40.0100.00716.88
7.4.00.0050.01314.93
7.3.330.0050.00013.20
7.3.320.0050.00013.15
7.3.310.0060.00316.50
7.3.300.0040.00416.48
7.3.290.0050.00216.43
7.3.280.0120.00316.43
7.3.260.0110.00916.68
7.3.240.0080.01116.51
7.3.230.0130.00616.63
7.3.210.0110.00716.55
7.3.200.0090.00916.85
7.3.190.0160.00016.50
7.3.180.0110.01116.48
7.3.170.0060.00916.47
7.3.160.0130.00316.98
7.3.120.0120.00314.98
7.3.110.0060.01215.01
7.3.100.0090.00915.16
7.3.90.0090.00614.92
7.3.80.0040.00715.20
7.3.70.0000.01414.66
7.3.60.0040.01215.09
7.3.50.0060.00915.18
7.3.40.0150.00415.12
7.3.30.0050.00515.13
7.3.20.0170.00016.98
7.3.10.0080.00516.80
7.3.00.0050.01316.67
7.2.330.0120.00616.88
7.2.320.0070.01116.88
7.2.310.0060.01216.71
7.2.300.0150.00616.61
7.2.290.0140.00316.68
7.2.250.0060.01315.21
7.2.240.0040.01515.42
7.2.230.0110.00415.12
7.2.220.0040.00815.28
7.2.210.0060.00315.00
7.2.200.0100.00315.22
7.2.190.0040.01115.41
7.2.180.0150.00415.38
7.2.170.0110.00715.46
7.2.160.0060.00915.35
7.2.150.0120.00317.10
7.2.140.0070.01116.91
7.2.130.0030.01517.05
7.2.120.0060.01016.98
7.2.110.0170.01216.06
7.2.100.0260.00816.05
7.2.90.0190.00515.90
7.2.80.0170.01016.11
7.2.70.0200.01016.30
7.2.60.0140.01216.21
7.2.50.0160.00916.26
7.2.40.0210.00316.22
7.2.30.0250.00316.28
7.2.20.0230.00716.12
7.2.10.0180.00916.22
7.2.00.0180.00716.24
7.1.330.0070.01015.92
7.1.320.0060.00915.73
7.1.310.0040.00716.00
7.1.300.0030.01016.13
7.1.290.0030.01315.98
7.1.280.0040.01116.06
7.1.270.0030.01416.20
7.1.260.0000.01615.78
7.1.250.0120.00415.86
7.1.240.0080.00515.96
7.1.230.0170.00715.18
7.1.220.0180.00614.97
7.1.210.0170.01214.91
7.1.200.0170.00914.78
7.1.190.0190.00715.17
7.1.180.0200.00515.07
7.1.170.0550.01015.09
7.1.160.0160.01115.04
7.1.150.0210.00515.15
7.1.140.0190.00815.08
7.1.130.0190.00815.09
7.1.120.0200.00515.03
7.1.110.0150.01415.24
7.1.100.0210.01215.01
7.1.90.0210.00715.13
7.1.80.0130.01315.14
7.1.70.0260.00615.19
7.1.60.0340.00824.11
7.1.50.0370.01023.92
7.1.40.0340.00724.17
7.1.30.0270.01324.05
7.1.20.0340.01023.99
7.1.10.0300.00915.13
7.1.00.0220.00614.97
7.0.330.0080.00815.56
7.0.320.0040.00715.61
7.0.310.0040.01215.48
7.0.300.0060.00915.71
7.0.290.0040.00415.49
7.0.280.0040.01115.52
7.0.270.0070.00315.71
7.0.260.0100.00315.59
7.0.250.0070.00715.57
7.0.240.0030.01015.66
7.0.230.0030.01015.50
7.0.220.0080.00315.65
7.0.210.0090.00615.62
7.0.200.0090.00915.64
7.0.190.0040.00415.57
7.0.180.0070.01015.70
7.0.170.0030.01015.49
7.0.160.0040.01115.59
7.0.150.0040.01115.38
7.0.140.0030.00515.43
7.0.130.0030.01315.69
7.0.120.0000.00915.68
7.0.110.0100.00715.61
7.0.100.0120.00315.64
7.0.90.0030.01315.76
7.0.80.0060.00315.40
7.0.70.0130.00015.50
7.0.60.0030.01015.35
7.0.50.0030.01315.50
7.0.40.0030.01313.73
7.0.30.0070.01013.70
7.0.20.0030.00713.48
7.0.10.0040.01113.66
7.0.00.0070.00413.68
5.6.400.0060.00914.59
5.6.390.0030.01214.64
5.6.380.0050.00914.57
5.6.370.0090.00914.75
5.6.360.0030.01014.29
5.6.350.0040.01114.81
5.6.340.0070.00314.41
5.6.330.0030.00714.72
5.6.320.0030.01014.49
5.6.310.0040.01414.89
5.6.300.0060.00914.47
5.6.290.0040.00714.57
5.6.280.0030.01314.45
5.6.270.0060.01214.76
5.6.260.0060.00614.46
5.6.250.0070.00714.47
5.6.240.0080.00614.65
5.6.230.0040.00414.65
5.6.220.0030.01314.65
5.6.210.0100.00514.26
5.6.200.0090.00914.28
5.6.190.0040.01514.41
5.6.180.0050.01014.41
5.6.170.0090.00614.41
5.6.160.0060.00914.41
5.6.150.0030.01014.60
5.6.140.0070.00314.76
5.6.130.0070.01014.36
5.6.120.0040.00814.63
5.6.110.0100.00714.29
5.6.100.0000.00914.73
5.6.90.0000.01314.55
5.6.80.0000.01214.68
5.6.70.0100.00314.32
5.6.60.0040.00714.30
5.6.50.0110.00414.75
5.6.40.0060.00614.41
5.6.30.0040.01114.66
5.6.20.0040.00714.52
5.6.10.0030.01014.30
5.6.00.0090.00614.46

preferences:
33.14 ms | 400 KiB | 5 Q