3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MetaTrait { private $methods = array(); public function addMethod($methodName, $methodCallable) { if (!is_callable($methodCallable)) { throw new InvalidArgumentException('Second param must be callable'); } $this->methods[$methodName] = Closure::bind($methodCallable, $this, get_class()); } public function __call($methodName, array $args) { if (isset($this->methods[$methodName])) { return call_user_func_array($this->methods[$methodName], $args); } throw RunTimeException('There is no method with the given name to call'); } } class HackThursday { use MetaTrait; private $dayOfWeek = 'Thursday'; } $test = new HackThursday(); $test->addMethod('fuck', function () { return 'fuck'; }); echo $test->fuck();

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.0040.01118.54
8.3.50.0150.01021.02
8.3.40.0110.00718.66
8.3.30.0130.00020.33
8.3.20.0050.00320.16
8.3.10.0080.00021.09
8.3.00.0080.00022.52
8.2.180.0140.00318.01
8.2.170.0110.00418.91
8.2.160.0110.00722.96
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00520.77
8.2.110.0030.00619.30
8.2.100.0090.00317.91
8.2.90.0040.00419.26
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0000.00917.93
8.2.50.0050.00318.07
8.2.40.0050.00318.15
8.2.30.0000.00819.55
8.2.20.0000.00817.67
8.2.10.0040.00417.76
8.2.00.0000.00717.64
8.1.280.0150.00025.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0000.00923.96
8.1.230.0060.00621.04
8.1.220.0040.00418.77
8.1.210.0000.00819.16
8.1.200.0000.00917.23
8.1.190.0000.00817.41
8.1.180.0040.00418.10
8.1.170.0080.00018.57
8.1.160.0000.00718.91
8.1.150.0040.00418.67
8.1.140.0040.00417.43
8.1.130.0080.00017.89
8.1.120.0020.00517.38
8.1.110.0040.00417.51
8.1.100.0040.00417.38
8.1.90.0080.00017.54
8.1.80.0040.00417.41
8.1.70.0040.00417.45
8.1.60.0040.00417.66
8.1.50.0040.00417.52
8.1.40.0040.00417.50
8.1.30.0070.00017.56
8.1.20.0000.00817.63
8.1.10.0080.00017.54
8.1.00.0060.00317.60
8.0.300.0040.00419.85
8.0.290.0080.00017.18
8.0.280.0070.00018.41
8.0.270.0040.00417.27
8.0.260.0030.00316.71
8.0.250.0030.00716.90
8.0.240.0000.00916.94
8.0.230.0000.00716.84
8.0.220.0000.00716.93
8.0.210.0030.00516.79
8.0.200.0000.00716.88
8.0.190.0080.00016.95
8.0.180.0070.00016.92
8.0.170.0030.00616.81
8.0.160.0040.00416.93
8.0.150.0040.00416.75
8.0.140.0000.01016.84
8.0.130.0050.00013.32
8.0.120.0040.00416.89
8.0.110.0000.00716.79
8.0.100.0000.00816.82
8.0.90.0040.00316.81
8.0.80.0060.01116.86
8.0.70.0040.00416.84
8.0.60.0040.00416.82
8.0.50.0040.00416.93
8.0.30.0070.01316.97
8.0.20.0090.00917.40
8.0.10.0000.00716.83
8.0.00.0120.02116.69
7.4.330.0050.00016.83
7.4.320.0000.00716.61
7.4.300.0000.00616.51
7.4.290.0040.00416.58
7.4.280.0000.00716.59
7.4.270.0030.00316.54
7.4.260.0040.00413.29
7.4.250.0000.00716.50
7.4.240.0040.00316.57
7.4.230.0030.00516.64
7.4.220.0060.01216.64
7.4.210.0060.00816.54
7.4.200.0070.00016.55
7.4.190.0030.00316.57
7.4.160.0040.01616.62
7.4.150.0090.00917.40
7.4.140.0120.00717.86
7.4.130.0110.00816.49
7.4.120.0070.01316.41
7.4.110.0130.00616.71
7.4.100.0080.01116.43
7.4.90.0130.01016.53
7.4.80.0130.01019.39
7.4.70.0160.00016.45
7.4.60.0100.01016.53
7.4.50.0030.00616.42
7.4.40.0060.00922.77
7.4.30.0100.00616.50
7.4.00.0060.01015.20
7.3.330.0000.00513.34
7.3.320.0030.00313.41
7.3.310.0050.00216.25
7.3.300.0060.00316.31
7.3.290.0070.01016.26
7.3.280.0080.00916.38
7.3.270.0130.00617.40
7.3.260.0060.01618.24
7.3.250.0150.00316.41
7.3.240.0060.01116.63
7.3.230.0070.01016.39
7.3.210.0090.01216.32
7.3.200.0070.01619.39
7.3.190.0070.01016.38
7.3.180.0130.00316.70
7.3.170.0090.00616.46
7.3.160.0070.01016.48
7.3.120.0070.00715.04
7.2.330.0100.01316.73
7.2.320.0070.01016.54
7.2.310.0070.01116.74
7.2.300.0070.01016.78
7.2.290.0040.01816.71
7.2.00.0030.00919.54
7.1.100.0030.00917.91
7.1.70.0030.00717.09
7.1.60.0120.00619.17
7.1.50.0090.00916.96
7.1.00.0070.06722.30
7.0.200.0030.00716.52
7.0.140.0070.07022.04
7.0.100.0000.05319.91
7.0.90.0300.07719.87
7.0.80.0100.08019.91
7.0.70.0100.06720.14
7.0.60.0100.07319.89
7.0.50.0070.07720.35
7.0.40.0070.07320.02
7.0.30.0000.07720.09
7.0.20.0070.07320.07
7.0.10.0070.08320.14
7.0.00.0030.05320.05
5.6.280.0070.07021.08
5.6.250.0070.04720.83
5.6.240.0100.07720.70
5.6.230.0030.05320.68
5.6.220.0130.07320.56
5.6.210.0030.08720.58
5.6.200.0030.08320.95
5.6.190.0100.06021.17
5.6.180.0270.06721.05
5.6.170.0070.08020.96
5.6.160.0070.08021.12
5.6.150.0100.08321.04
5.6.140.0070.08021.05
5.6.130.0100.05321.12
5.6.120.0100.07021.03
5.6.110.0130.08721.14
5.6.100.0070.04721.08
5.6.90.0070.07720.95
5.6.80.0030.07720.47
5.6.70.0030.08320.32
5.6.60.0070.04720.43
5.6.50.0130.07320.50
5.6.40.0130.08020.34
5.6.30.0000.06320.50
5.6.20.0030.08320.40
5.6.10.0070.04720.30
5.6.00.0030.08720.37
5.5.380.0100.07720.45
5.5.370.0000.08320.38
5.5.360.0030.08320.45
5.5.350.0230.07320.38
5.5.340.0200.06320.91
5.5.330.0070.04720.84
5.5.320.0000.09020.77
5.5.310.0030.08720.88
5.5.300.0070.08320.91
5.5.290.0070.07720.70
5.5.280.0100.07320.90
5.5.270.0030.09020.80
5.5.260.0170.07720.88
5.5.250.0000.07720.76
5.5.240.0070.07720.27
5.5.230.0030.08020.19
5.5.220.0130.07720.19
5.5.210.0100.03720.22
5.5.200.0170.04720.23
5.5.190.0070.08320.27
5.5.180.0070.08020.28
5.5.160.0030.07020.12
5.5.150.0070.08020.28
5.5.140.0000.08720.23
5.5.130.0070.08320.19
5.5.120.0070.08020.23
5.5.110.0130.05719.98
5.5.100.0130.07320.11
5.5.90.0030.07720.06
5.5.80.0070.06720.08
5.5.70.0100.07319.95
5.5.60.0070.04320.13
5.5.50.0030.04319.95
5.5.40.0130.06020.05
5.5.30.0030.06020.07
5.5.20.0070.04720.06
5.5.10.0100.07019.98
5.5.00.0100.04019.98
5.4.450.0030.07319.56
5.4.440.0070.07719.45
5.4.430.0130.06019.17
5.4.420.0070.08719.50
5.4.410.0030.06719.32
5.4.400.0030.08018.90
5.4.390.0100.07319.02
5.4.380.0030.06319.12
5.4.370.0070.07318.88
5.4.360.0130.07019.16
5.4.350.0070.07319.03
5.4.340.0070.07318.95
5.4.320.0100.08019.02
5.4.310.0070.05319.12
5.4.300.0070.08018.90
5.4.290.0030.07319.04
5.4.280.0070.08019.12
5.4.270.0000.08019.06
5.4.260.0130.07719.13
5.4.250.0100.07318.90
5.4.240.0130.06019.04
5.4.230.0070.07318.87
5.4.220.0030.07019.22
5.4.210.0000.04719.09
5.4.200.0070.04719.15
5.4.190.0030.05319.22
5.4.180.0070.08018.89
5.4.170.0030.05319.14
5.4.160.0130.03718.83
5.4.150.0100.07718.88
5.4.140.0100.07716.52
5.4.130.0070.07716.50
5.4.120.0070.07716.38
5.4.110.0070.07716.48
5.4.100.0130.07016.39
5.4.90.0000.08016.49
5.4.80.0130.07016.47
5.4.70.0070.07316.39
5.4.60.0130.06716.52
5.4.50.0070.07316.48
5.4.40.0130.06316.46
5.4.30.0070.04716.26
5.4.20.0100.06316.33
5.4.10.0070.07316.30
5.4.00.0070.07315.77
5.3.290.0030.07714.65
5.3.280.0030.07314.45
5.3.270.0070.06314.58
5.3.260.0100.06714.43
5.3.250.0070.04714.52
5.3.240.0030.08014.52
5.3.230.0030.07314.45
5.3.220.0030.07714.54
5.3.210.0100.07314.57
5.3.200.0070.05314.53
5.3.190.0030.07714.54
5.3.180.0070.05314.56
5.3.170.0070.08014.54
5.3.160.0070.07314.54
5.3.150.0130.07314.42
5.3.140.0100.07714.38
5.3.130.0070.07014.37
5.3.120.0030.06014.54
5.3.110.0170.03714.53
5.3.100.0130.06014.04
5.3.90.0070.07713.96
5.3.80.0100.05313.87
5.3.70.0200.06013.80
5.3.60.0100.04713.77
5.3.50.0030.07013.88
5.3.40.0030.07713.90
5.3.30.0100.06313.76
5.3.20.0100.06713.68
5.3.10.0030.07313.59
5.3.00.0070.07013.54
5.2.170.0070.06010.93
5.2.160.0030.06011.21
5.2.150.0200.02711.09
5.2.140.0070.06310.95
5.2.130.0030.06011.09
5.2.120.0130.03011.11
5.2.110.0030.06711.16
5.2.100.0070.06311.06
5.2.90.0070.04311.09
5.2.80.0030.06310.89
5.2.70.0100.05711.11
5.2.60.0030.05310.99
5.2.50.0070.06011.00
5.2.40.0070.05710.84
5.2.30.0100.05310.80
5.2.20.0070.06310.95
5.2.10.0100.02710.78
5.2.00.0000.05310.64
5.1.60.0000.0539.98
5.1.50.0000.05710.04
5.1.40.0070.04010.02
5.1.30.0070.05310.39
5.1.20.0070.02710.41
5.1.10.0100.04310.07
5.1.00.0070.05710.13
5.0.50.0030.0208.85
5.0.40.0030.0238.85
5.0.30.0030.0708.85
5.0.20.0070.0408.85
5.0.10.0070.0438.85
5.0.00.0070.0478.85
4.4.90.0000.0408.85
4.4.80.0000.0338.85
4.4.70.0070.0138.85
4.4.60.0070.0308.85
4.4.50.0070.0338.85
4.4.40.0000.0338.85
4.4.30.0030.0338.85
4.4.20.0000.0238.85
4.4.10.0070.0178.85
4.4.00.0030.0438.85
4.3.110.0100.0308.85
4.3.100.0000.0338.85
4.3.90.0030.0238.85
4.3.80.0000.0578.85
4.3.70.0000.0338.85
4.3.60.0030.0278.85
4.3.50.0000.0338.85
4.3.40.0070.0508.85
4.3.30.0000.0308.85
4.3.20.0030.0238.85
4.3.10.0030.0338.85
4.3.00.0030.0338.85

preferences:
61.94 ms | 401 KiB | 5 Q