3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function n($n, $return_method = false) { if ($return_method) return __FUNCTION__; return "N is $n"; } } $test = new Test; $method = $test->n(5, true); print $method . PHP_EOL; print $test->$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.0140.00418.43
8.3.60.0060.01216.50
8.3.50.0120.00918.03
8.3.40.0160.00618.66
8.3.30.0070.01018.68
8.3.20.0040.00421.77
8.3.10.0080.00023.50
8.3.00.0060.00621.95
8.2.190.0030.01416.63
8.2.180.0060.01218.54
8.2.170.0070.00722.96
8.2.160.0140.00020.35
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0080.00019.45
8.2.120.0000.00826.35
8.2.110.0040.00420.52
8.2.100.0060.00617.91
8.2.90.0000.00817.88
8.2.80.0030.00818.84
8.2.70.0040.00417.80
8.2.60.0030.00617.93
8.2.50.0030.00618.10
8.2.40.0000.00720.42
8.2.30.0030.00619.35
8.2.20.0050.00318.05
8.2.10.0040.00418.13
8.2.00.0040.00417.93
8.1.280.0100.00725.92
8.1.270.0080.00023.97
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.19
8.1.230.0040.00717.76
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0050.00317.23
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0040.00418.86
8.1.160.0000.00818.88
8.1.150.0000.00718.92
8.1.140.0070.00017.74
8.1.130.0030.00318.91
8.1.120.0030.00317.36
8.1.110.0000.00717.41
8.1.100.0080.00017.34
8.1.90.0050.00517.42
8.1.80.0080.00017.52
8.1.70.0030.00317.48
8.1.60.0040.00417.57
8.1.50.0000.00817.57
8.1.40.0040.00417.50
8.1.30.0050.00317.65
8.1.20.0040.00717.70
8.1.10.0000.00817.56
8.1.00.0030.00717.56
8.0.300.0000.00718.77
8.0.290.0070.00016.63
8.0.280.0070.00018.45
8.0.270.0030.00317.27
8.0.260.0000.00717.25
8.0.250.0040.00416.95
8.0.240.0000.00716.83
8.0.230.0000.00816.81
8.0.220.0060.00316.89
8.0.210.0030.00316.95
8.0.200.0030.00716.93
8.0.190.0040.00416.86
8.0.180.0000.00716.93
8.0.170.0080.00016.90
8.0.160.0070.00316.95
8.0.150.0080.00016.84
8.0.140.0000.00716.82
8.0.130.0060.00013.35
8.0.120.0040.00416.90
8.0.110.0050.00316.79
8.0.100.0000.00816.80
8.0.90.0000.00716.75
8.0.80.0060.01016.77
8.0.70.0030.00516.91
8.0.60.0060.00316.79
8.0.50.0070.00016.95
8.0.30.0100.00817.21
8.0.20.0110.00817.42
8.0.10.0050.00216.98
8.0.00.0100.00816.75
7.4.330.0000.00515.55
7.4.320.0060.00016.52
7.4.300.0030.00316.53
7.4.290.0030.00316.66
7.4.280.0000.00816.48
7.4.270.0000.00716.58
7.4.260.0000.00816.48
7.4.250.0000.00816.48
7.4.240.0070.00016.61
7.4.230.0030.00316.53
7.4.220.0000.00716.30
7.4.210.0060.01116.54
7.4.200.0030.00316.58
7.4.160.0110.00816.53
7.4.140.0090.01117.86
7.4.130.0120.00616.58
7.4.120.0140.00716.50
7.4.110.0060.01116.26
7.4.100.0150.00616.52
7.4.90.0190.00316.64
7.4.80.0120.01319.39
7.4.70.0120.00316.60
7.4.60.0150.00016.36
7.4.50.0040.01116.59
7.4.40.0180.00616.44
7.4.00.0060.00614.94
7.3.330.0050.00013.32
7.3.320.0030.00213.39
7.3.310.0000.00716.35
7.3.300.0070.00016.23
7.3.290.0000.00716.29
7.3.280.0080.00716.31
7.3.260.0080.01016.37
7.3.240.0080.00916.45
7.3.230.0140.00316.24
7.3.210.0100.00616.36
7.3.200.0110.00616.45
7.3.190.0090.00616.54
7.3.180.0040.01216.29
7.3.170.0110.00616.57
7.3.160.0140.00316.55
7.2.330.0030.01416.49
7.2.320.0100.00716.72
7.2.310.0060.01316.48
7.2.300.0090.00616.70
7.2.290.0140.00416.74
7.2.60.0040.00916.63
7.2.40.0220.01317.94
7.2.30.0260.00917.75
7.2.20.0250.00918.04
7.2.10.0520.01317.89
7.2.00.0340.01117.77
7.1.200.0060.00015.52
7.1.160.0310.01016.93
7.1.150.0530.00516.90
7.1.140.0440.01316.85
7.1.130.0480.00716.94
7.1.120.0520.01216.77
7.1.110.0280.01316.08
7.1.100.0310.00916.23
7.1.90.0370.00916.00
7.1.80.0300.01116.18
7.1.70.0510.01215.02
7.1.60.0510.01133.26
7.1.50.0460.01433.03
7.1.40.0590.01332.59
7.1.30.0530.01132.51
7.1.20.0520.00932.84
7.1.10.0310.01114.80
7.1.00.0330.00914.86

preferences:
45.91 ms | 401 KiB | 5 Q