3v4l.org

run code in 300+ PHP versions simultaneously
<?php class salutations { public function hello() { return "Hello World!"; } } class methodFactory { public function __construct($instance) { $this->package = $instance; } public function getPackageMethod($method) { if (method_exists($this->package, $method)) { $f = function($method) { return $this->$method; }; Closure::bind($f, $this->package); return $f; } } } $salutationsInstance = new salutations(); $obj = new methodFactory($salutationsInstance); $hello = $obj->getPackageMethod('hello'); $hello();

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.0110.01116.61
8.3.50.0250.00421.95
8.3.40.0140.00718.70
8.3.30.0110.00318.84
8.3.20.0080.00020.16
8.3.10.0030.00623.70
8.3.00.0030.00618.05
8.2.180.0190.00418.29
8.2.170.0040.01122.96
8.2.160.0080.00820.13
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00817.75
8.2.110.0000.01120.34
8.2.100.0040.00817.93
8.2.90.0030.00519.12
8.2.80.0000.00817.97
8.2.70.0000.00817.63
8.2.60.0000.01217.78
8.2.50.0050.00318.07
8.2.40.0050.00521.11
8.2.30.0000.00720.70
8.2.20.0080.00017.75
8.2.10.0030.00518.08
8.2.00.0000.00717.94
8.1.280.0140.00325.92
8.1.270.0140.00023.97
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.64
8.1.230.0080.00417.66
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0000.00917.35
8.1.190.0000.00817.11
8.1.180.0040.00418.10
8.1.170.0030.00620.23
8.1.160.0000.00721.93
8.1.150.0020.00518.94
8.1.140.0000.00921.36
8.1.130.0030.00317.63
8.1.120.0050.00317.50
8.1.110.0000.00717.32
8.1.100.0000.00817.37
8.1.90.0070.00017.46
8.1.80.0030.00517.36
8.1.70.0030.00317.48
8.1.60.0000.00717.60
8.1.50.0050.00317.58
8.1.40.0030.00517.46
8.1.30.0000.00817.56
8.1.20.0000.00817.65
8.1.10.0000.00817.57
8.1.00.0000.00817.37
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0030.00318.45
8.0.270.0060.00317.25
8.0.260.0060.00017.13
8.0.250.0040.00416.98
8.0.240.0040.00417.01
8.0.230.0040.00416.96
8.0.220.0030.00516.82
8.0.210.0000.00716.75
8.0.200.0000.00716.90
8.0.190.0000.00817.04
8.0.180.0050.00316.95
8.0.170.0050.00317.05
8.0.160.0000.00816.83
8.0.150.0070.00016.84
8.0.140.0050.00216.91
8.0.130.0070.00013.43
8.0.120.0000.00816.95
8.0.110.0070.00016.98
8.0.100.0070.00017.00
8.0.90.0000.00717.08
8.0.80.0130.00616.91
8.0.70.0050.00316.90
8.0.60.0070.00016.77
8.0.50.0000.00816.97
8.0.30.0100.00917.05
8.0.20.0050.01417.40
8.0.10.0040.00417.14
8.0.00.0060.01316.84
7.4.330.0000.00515.08
7.4.320.0000.00716.53
7.4.300.0040.00416.44
7.4.290.0000.00716.66
7.4.280.0000.01016.41
7.4.270.0030.00316.51
7.4.260.0070.00016.64
7.4.250.0000.00716.55
7.4.240.0040.00316.49
7.4.230.0000.00716.43
7.4.220.0070.01116.55
7.4.210.0000.01516.52
7.4.200.0030.00316.42
7.4.160.0030.01316.39
7.4.150.0100.00717.40
7.4.140.0110.00817.86
7.4.130.0060.01316.61
7.4.120.0110.01216.63
7.4.110.0090.00916.59
7.4.100.0080.00816.52
7.4.90.0060.01016.44
7.4.80.0040.01319.39
7.4.70.0070.01516.34
7.4.60.0120.00416.61
7.4.50.0060.00316.22
7.4.40.0100.00716.38
7.4.30.0130.01016.64
7.4.00.0060.00915.15
7.3.330.0030.00313.33
7.3.320.0060.00013.34
7.3.310.0050.00316.36
7.3.300.0040.00416.33
7.3.290.0080.00916.35
7.3.280.0080.00716.40
7.3.270.0150.00917.40
7.3.260.0070.01316.59
7.3.240.0090.01016.44
7.3.230.0000.02016.52
7.3.210.0070.01016.47
7.3.200.0070.01616.52
7.3.190.0120.00316.36
7.3.180.0100.00616.38
7.3.170.0060.00916.57
7.3.160.0060.00916.53
7.2.330.0160.00316.81
7.2.320.0070.01016.75
7.2.310.0060.00916.69
7.2.300.0080.00816.71
7.2.290.0120.00616.69
7.2.60.0060.00616.56
7.2.00.0040.00819.27
7.1.200.0000.01115.63
7.1.100.0070.00718.16
7.1.70.0060.00616.87
7.1.60.0180.00719.50
7.1.50.0100.00616.93
7.1.00.0030.07722.48
7.0.200.0030.00616.79
7.0.60.0130.07719.78
7.0.50.0030.04717.96
7.0.40.0100.08020.15
7.0.30.0170.04720.07
7.0.20.0200.04320.20
7.0.10.0030.05020.26
7.0.00.0100.05020.18
5.6.280.0070.07320.91
5.6.210.0030.08020.51
5.6.200.0070.05718.20
5.6.190.0100.04720.46
5.6.180.0330.07320.69
5.6.170.0100.05320.55
5.6.160.0030.05320.43
5.6.150.0070.05318.17
5.6.140.0030.04318.19
5.6.130.0100.05018.17
5.6.120.0100.06721.01
5.6.110.0000.07021.00
5.6.100.0130.08321.12
5.6.90.0100.08021.00
5.6.80.0070.03720.39
5.5.350.0000.08720.46
5.5.340.0030.04017.98
5.5.330.0070.08320.19
5.5.320.3900.03320.28
5.5.310.0200.06720.38
5.5.300.0000.07017.93
5.5.290.0030.06317.93
5.5.280.0130.07720.82
5.5.270.0170.05720.71
5.5.260.0100.08320.66
5.5.250.0200.06320.58
5.5.240.0000.03320.16
5.4.450.0830.07019.58
5.4.440.0800.05719.35
5.4.430.0730.05319.43
5.4.420.0600.06019.28
5.4.410.0630.05319.49
5.4.400.0670.05018.81
5.4.390.0730.04718.81
5.4.380.0600.05319.26
5.4.370.0670.05018.98
5.4.360.0770.04319.11
5.4.350.0630.05319.25
5.4.340.0570.06018.81
5.4.320.0670.05319.26
5.4.310.0570.05719.14
5.4.300.0730.04319.25
5.4.290.0700.04319.14
5.4.280.0600.05719.13
5.4.270.0800.05319.10
5.4.260.0700.04019.19
5.4.250.0670.05019.26
5.4.240.0600.05319.10
5.4.230.0570.05718.84
5.4.220.0570.06019.34
5.4.210.0570.05719.25
5.4.200.0730.04018.80
5.4.190.0570.05719.25
5.4.180.0630.05019.04
5.4.170.0600.05319.18
5.4.160.0700.04318.98
5.4.150.0600.06319.23
5.4.140.0770.04316.59
5.4.130.0600.05016.44
5.4.120.0470.05316.59
5.4.110.0070.05316.21
5.4.100.0100.05016.30
5.4.90.0200.05316.48
5.4.80.0700.05716.29
5.4.70.0470.05016.55
5.4.60.0370.05716.59
5.4.50.0670.05316.36
5.4.40.0730.07016.23
5.4.30.0630.04016.41
5.4.20.0000.05716.42
5.4.10.0170.04316.38
5.4.00.0330.05715.80

preferences:
54.9 ms | 401 KiB | 5 Q