3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function n($n, $return_method = false) { if ($return_method) return "Test->n"; // __METHOD__; return "N is $n"; } } $test = new Test; $method = $test->n(5, true); print $method . PHP_EOL; print $method(5) . 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.0150.00018.43
8.3.60.0090.00916.63
8.3.50.0210.00018.03
8.3.40.0090.00618.83
8.3.30.0070.00718.68
8.3.20.0040.00421.88
8.3.10.0050.00323.53
8.3.00.0030.01021.78
8.2.190.0170.00316.58
8.2.180.0090.00918.42
8.2.170.0100.01022.96
8.2.160.0040.01120.35
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0050.00319.33
8.2.120.0050.00326.35
8.2.110.0030.00719.27
8.2.100.0060.00617.91
8.2.90.0030.00519.77
8.2.80.0050.00318.22
8.2.70.0060.00318.04
8.2.60.0060.00318.04
8.2.50.0080.00018.10
8.2.40.0000.00920.41
8.2.30.0040.00419.38
8.2.20.0070.00318.05
8.2.10.0000.00717.93
8.2.00.0000.00918.07
8.1.280.0070.00725.92
8.1.270.0000.00823.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00722.51
8.1.230.0090.00320.90
8.1.220.0060.00317.79
8.1.210.0030.00518.85
8.1.200.0040.00417.35
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0080.00020.54
8.1.160.0040.00418.75
8.1.150.0070.00018.89
8.1.140.0000.00717.60
8.1.130.0000.00719.05
8.1.120.0000.00817.30
8.1.110.0030.00517.40
8.1.100.0020.00517.25
8.1.90.0060.00317.29
8.1.80.0040.00417.28
8.1.70.0000.00717.42
8.1.60.0080.00017.60
8.1.50.0000.00817.52
8.1.40.0040.00417.42
8.1.30.0000.00817.61
8.1.20.0030.00917.58
8.1.10.0090.00017.58
8.1.00.0030.00617.57
8.0.300.0030.00320.16
8.0.290.0040.00416.88
8.0.280.0030.00318.36
8.0.270.0000.00717.25
8.0.260.0030.00317.16
8.0.250.0040.00416.92
8.0.240.0060.00316.89
8.0.230.0000.01116.95
8.0.220.0030.00616.83
8.0.210.0070.00016.93
8.0.200.0040.00417.07
8.0.190.0000.00717.02
8.0.180.0000.00816.88
8.0.170.0030.00616.96
8.0.160.0060.00617.05
8.0.150.0050.00216.89
8.0.140.0000.00716.93
8.0.130.0000.00513.42
8.0.120.0050.00216.93
8.0.110.0040.00417.06
8.0.100.0050.00216.95
8.0.90.0050.00317.02
8.0.80.0040.01416.93
8.0.70.0050.00317.06
8.0.60.0040.00417.01
8.0.50.0040.00417.01
8.0.30.0080.01017.11
8.0.20.0080.01017.40
8.0.10.0000.00717.08
8.0.00.0080.00816.81
7.4.330.0000.00515.55
7.4.320.0000.00616.55
7.4.300.0060.00016.55
7.4.290.0040.00416.45
7.4.280.0040.00416.44
7.4.270.0050.00216.60
7.4.260.0070.00016.52
7.4.250.0020.00516.54
7.4.240.0070.00016.50
7.4.230.0030.00316.39
7.4.220.0040.00416.59
7.4.210.0070.01016.46
7.4.200.0050.00216.70
7.4.160.0100.00716.52
7.4.140.0110.00917.86
7.4.130.0080.01116.57
7.4.120.0120.00716.56
7.4.110.0130.00416.49
7.4.100.0040.01216.43
7.4.90.0100.00616.38
7.4.80.0130.01019.39
7.4.70.0110.00616.59
7.4.60.0030.01316.33
7.4.50.0000.01516.25
7.4.40.0160.01016.62
7.4.00.0140.00015.02
7.3.330.0050.00013.36
7.3.320.0030.00313.33
7.3.310.0040.00416.40
7.3.300.0030.00316.37
7.3.290.0000.00716.33
7.3.280.0060.00916.32
7.3.260.0120.00616.39
7.3.240.0070.01016.40
7.3.230.0060.01016.46
7.3.210.0030.01316.39
7.3.200.0030.01316.61
7.3.190.0070.01016.36
7.3.180.0130.00316.40
7.3.170.0060.01016.58
7.3.160.0120.00616.48
7.2.330.0030.01516.64
7.2.320.0070.01016.68
7.2.310.0060.01316.72
7.2.300.0090.01216.81
7.2.290.0100.01416.76
7.2.80.0060.00616.46
7.2.60.0100.00317.01
7.2.40.0250.01619.73
7.2.30.0120.01119.68
7.2.20.0060.01219.48
7.2.10.0080.01119.86
7.2.00.0090.01619.63
7.1.200.0030.00615.91
7.1.160.0090.01018.58
7.1.150.0070.01018.39
7.1.140.0050.01318.37
7.1.130.0080.00818.66
7.1.120.0070.00918.39
7.1.110.0060.01218.09
7.1.100.0090.00818.24
7.1.90.0070.00917.98
7.1.80.0080.00818.10
7.1.70.0100.00916.88
7.1.60.0240.01135.14
7.1.50.0280.01234.79
7.1.40.0260.01134.20
7.1.30.0270.01234.51
7.1.20.0310.01834.44
7.1.10.0070.01616.48
7.1.00.0040.01116.50

preferences:
59.6 ms | 401 KiB | 5 Q