3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r(getMonth(null)); function getMonth($d) { return dtf($d,'n'); } function getQuarter($d) { return ceil( getMonth($d) / 3); } function dtf($date, $format = 'd.m.Y'){ $date = new DateTime($date); return $date->format($format); }

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.40.0120.00318.74
8.3.30.0070.00718.59
8.3.20.0050.00320.21
8.3.10.0000.00823.48
8.3.00.0070.00019.66
8.2.170.0090.00622.96
8.2.160.0070.00720.43
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00321.09
8.2.120.0080.00026.35
8.2.110.0090.00020.97
8.2.100.0110.00017.92
8.2.90.0000.00919.08
8.2.80.0000.00817.97
8.2.70.0050.00317.84
8.2.60.0050.00317.93
8.2.50.0030.00618.07
8.2.40.0000.00820.95
8.2.30.0050.00320.57
8.2.20.0000.00817.88
8.2.10.0020.00518.07
8.2.00.0070.00018.07
8.1.270.0070.00720.43
8.1.260.0070.00028.09
8.1.250.0000.00828.09
8.1.240.0040.00422.42
8.1.230.0060.00617.66
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0040.00418.71
8.1.160.0040.00420.77
8.1.150.0000.00718.89
8.1.140.0040.00419.57
8.1.130.0030.00317.69
8.1.120.0070.00017.50
8.1.110.0040.00417.64
8.1.100.0040.00417.54
8.1.90.0000.00717.59
8.1.80.0000.00817.62
8.1.70.0050.00317.51
8.1.60.0030.00517.67
8.1.50.0030.00517.65
8.1.40.0000.00817.70
8.1.30.0000.00817.74
8.1.20.0030.00517.73
8.1.10.0000.00817.67
8.1.00.0060.00317.61
8.0.300.0050.00318.77
8.0.290.0070.00016.88
8.0.280.0000.00718.45
8.0.270.0000.00717.15
8.0.260.0000.00617.23
8.0.250.0000.00716.97
8.0.240.0040.00417.06
8.0.230.0030.00717.05
8.0.220.0040.00416.92
8.0.210.0000.00716.91
8.0.200.0000.00617.10
8.0.190.0080.00016.99
8.0.180.0050.00316.95
8.0.170.0040.00416.98
8.0.160.0000.00717.00
8.0.150.0040.00416.88
8.0.140.0050.00316.86
8.0.130.0030.00313.43
8.0.120.0070.00017.08
8.0.110.0000.00717.04
8.0.100.0040.00417.07
8.0.90.0000.00816.91
8.0.80.0090.00617.00
8.0.70.0080.00017.05
8.0.60.0040.00417.04
8.0.50.0000.00716.98
8.0.30.0090.01017.19
8.0.20.0080.01117.42
8.0.10.0030.00517.08
8.0.00.0070.01116.76
7.4.330.0030.00216.67
7.4.320.0000.00716.60
7.4.300.0030.00316.73
7.4.290.0070.00016.54
7.4.280.0000.00916.75
7.4.270.0060.00316.68
7.4.260.0000.00716.70
7.4.250.0070.00016.62
7.4.240.0060.00116.66
7.4.230.0070.00016.64
7.4.220.0070.01516.68
7.4.210.0070.00716.77
7.4.200.0030.00316.81
7.4.160.0130.00316.58
7.4.150.0100.00717.40
7.4.140.0110.01317.86
7.4.130.0090.01016.48
7.4.120.0090.00916.63
7.4.110.0250.00316.55
7.4.100.0160.00716.46
7.4.90.0060.01016.46
7.4.80.0120.00619.39
7.4.70.0110.00516.53
7.4.60.0030.01316.55
7.4.50.0080.00316.63
7.4.40.0040.01516.57
7.4.30.0080.00816.63
7.4.00.0030.01015.25
7.3.330.0030.00313.32
7.3.320.0040.00413.18
7.3.310.0030.00316.28
7.3.300.0070.00016.39
7.3.290.0070.00816.39
7.3.280.0100.00416.38
7.3.270.0130.01017.40
7.3.260.0070.01116.42
7.3.250.0100.01016.45
7.3.240.0140.00716.56
7.3.230.0070.01016.43
7.3.210.0120.00416.61
7.3.200.0110.00716.30
7.3.190.0140.00316.58
7.3.180.0030.01416.23
7.3.170.0070.01016.38
7.3.160.0130.00916.71
7.3.10.0100.00516.52
7.3.00.0100.00316.47
7.2.330.0070.01016.67
7.2.320.0130.00716.60
7.2.310.0100.00716.76
7.2.300.0070.01016.88
7.2.290.0130.00316.50
7.2.130.0160.00816.28
7.2.120.0130.00416.46
7.2.110.0150.00616.57
7.2.100.0120.00316.47
7.2.90.0140.00716.49
7.2.80.0080.00816.58
7.2.70.0110.00616.41
7.2.60.0100.00916.64
7.2.50.0090.00716.34
7.2.40.0220.00616.46
7.2.30.0150.00916.86
7.2.20.0100.01016.54
7.2.10.0180.00716.62
7.2.00.0050.01018.20
7.1.250.0240.00415.92
7.1.200.0030.00515.73
7.1.100.0830.01016.33
7.1.70.0000.01317.21
7.1.60.0070.00419.13
7.1.50.0150.00616.90
7.1.00.0070.07322.45
7.0.200.0000.01116.79
7.0.60.0100.08019.89
7.0.50.0070.07717.89
7.0.40.0030.04720.41
7.0.30.0170.07320.10
7.0.20.0230.08320.23
7.0.10.0030.06020.16
7.0.00.0130.07320.22
5.6.280.0100.06720.91
5.6.210.0030.07720.48
5.6.200.0070.07018.19
5.6.190.0070.07720.50
5.6.180.0070.04320.57
5.6.170.0170.05020.55
5.6.160.0070.07020.47
5.6.150.0070.07718.25
5.6.140.0070.05718.14
5.6.130.0000.04318.16
5.6.120.0100.05321.00
5.6.110.0100.04720.97
5.6.100.0000.04321.01
5.6.90.0100.06321.13
5.6.80.0170.07720.36
5.5.350.3330.04020.37
5.5.340.0070.03318.04
5.5.330.0070.07320.21
5.5.320.0170.04320.51
5.5.310.0200.03720.31
5.5.300.0070.06017.98
5.5.290.0070.04317.98
5.5.280.0000.09020.80
5.5.270.0070.08020.64
5.5.260.0070.08720.97
5.5.250.0100.05320.50
5.5.240.0170.07320.29

preferences:
60.23 ms | 400 KiB | 5 Q