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() { return $this->package->$method; }; Closure::bind($f, $this); 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.0180.00416.75
8.3.50.0170.00121.21
8.3.40.0110.00718.84
8.3.30.0110.00418.71
8.3.20.0000.00720.16
8.3.10.0030.00521.85
8.3.00.0040.00419.79
8.2.180.0110.00418.42
8.2.170.0090.00622.96
8.2.160.0100.00320.35
8.2.150.0080.00024.18
8.2.140.0000.00924.66
8.2.130.0050.00226.16
8.2.120.0080.00020.94
8.2.110.0040.00822.18
8.2.100.0030.00917.93
8.2.90.0040.00419.11
8.2.80.0000.00917.97
8.2.70.0090.00017.63
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0050.00321.06
8.2.30.0030.00320.63
8.2.20.0040.00417.66
8.2.10.0030.00617.97
8.2.00.0080.00017.95
8.1.280.0140.00625.92
8.1.270.0140.00423.75
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0040.00422.46
8.1.230.0080.00417.76
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0030.00617.48
8.1.190.0040.00417.13
8.1.180.0060.00318.10
8.1.170.0080.00020.38
8.1.160.0000.01021.89
8.1.150.0000.00718.86
8.1.140.0080.00019.48
8.1.130.0070.00017.71
8.1.120.0000.00717.47
8.1.110.0040.00417.37
8.1.100.0030.00317.48
8.1.90.0000.00817.44
8.1.80.0040.00417.36
8.1.70.0000.00817.47
8.1.60.0000.00817.60
8.1.50.0040.00417.49
8.1.40.0080.00017.41
8.1.30.0080.00017.67
8.1.20.0040.00417.58
8.1.10.0030.00617.61
8.1.00.0000.00817.38
8.0.300.0030.00518.77
8.0.290.0090.00016.63
8.0.280.0070.00018.43
8.0.270.0040.00417.26
8.0.260.0030.00317.30
8.0.250.0000.00717.04
8.0.240.0040.00417.04
8.0.230.0030.00316.94
8.0.220.0040.00416.98
8.0.210.0000.00716.98
8.0.200.0050.00317.02
8.0.190.0000.00817.08
8.0.180.0040.00416.96
8.0.170.0040.00417.05
8.0.160.0080.00016.98
8.0.150.0050.00216.80
8.0.140.0070.00016.79
8.0.130.0000.00613.33
8.0.120.0030.00516.80
8.0.110.0000.00716.85
8.0.100.0020.00516.82
8.0.90.0070.00016.80
8.0.80.0140.00717.00
8.0.70.0040.00416.73
8.0.60.0050.00216.83
8.0.50.0050.00316.89
8.0.30.0120.00717.04
8.0.20.0120.00617.40
8.0.10.0070.00017.14
8.0.00.0050.01216.85
7.4.330.0000.00515.11
7.4.320.0030.00316.65
7.4.300.0060.00016.64
7.4.290.0030.00316.50
7.4.280.0000.00916.40
7.4.270.0000.00716.50
7.4.260.0000.00716.41
7.4.250.0080.00016.57
7.4.240.0050.00316.53
7.4.230.0000.00716.62
7.4.220.0100.01716.57
7.4.210.0130.00316.54
7.4.200.0070.00016.67
7.4.160.0060.01016.48
7.4.150.0030.01317.40
7.4.140.0130.01617.86
7.4.130.0110.01116.50
7.4.120.0100.01016.47
7.4.110.0110.00816.51
7.4.100.0190.00316.48
7.4.90.0140.00716.73
7.4.80.0100.01319.39
7.4.70.0160.00716.64
7.4.60.0070.01016.73
7.4.50.0090.00016.61
7.4.40.0130.00316.61
7.4.30.0090.00916.74
7.4.00.0090.00914.62
7.3.330.0000.00513.29
7.3.320.0030.00313.29
7.3.310.0030.00516.29
7.3.300.0070.00016.26
7.3.290.0110.01016.46
7.3.280.0100.00916.41
7.3.270.0110.00717.40
7.3.260.0120.00616.36
7.3.240.0060.01416.38
7.3.230.0120.00916.57
7.3.210.0060.01216.42
7.3.200.0080.00816.47
7.3.190.0060.01516.38
7.3.180.0180.00316.45
7.3.170.0060.00916.41
7.3.160.0060.00916.42
7.2.330.0110.00716.50
7.2.320.0140.00316.71
7.2.310.0080.00816.41
7.2.300.0130.00316.75
7.2.290.0090.00916.63
7.2.60.0060.00617.05
7.1.200.0110.00415.71
7.1.70.0090.00917.21
7.1.60.0060.01619.50
7.1.50.0070.01417.05
7.1.00.0000.08022.24
7.0.200.0060.00316.72
7.0.60.0030.04320.02
7.0.50.0030.04717.83
7.0.40.0070.07020.04
7.0.30.0300.06320.11
7.0.20.0100.04720.15
7.0.10.0270.06320.20
7.0.00.0000.04320.22
5.6.280.0030.07320.84
5.6.210.0100.07720.75
5.6.200.0100.06318.18
5.6.190.0030.07720.55
5.6.180.0270.05020.64
5.6.170.0300.04020.55
5.6.160.0070.05320.61
5.6.150.0070.05318.19
5.6.140.0030.06018.18
5.6.130.0030.05718.11
5.6.120.0030.08720.89
5.6.110.0070.08721.05
5.6.100.0070.08721.11
5.6.90.0070.07321.11
5.6.80.0100.04020.43
5.5.350.0000.04320.41
5.5.340.0100.08017.99
5.5.330.0000.04320.27
5.5.320.3230.04320.33
5.5.310.0200.05320.27
5.5.300.0030.06317.95
5.5.290.0130.05717.98
5.5.280.0100.03320.80
5.5.270.0070.05720.96
5.5.260.0130.08020.69
5.5.250.0130.08320.79
5.5.240.0070.06020.27
5.4.450.0200.05319.36
5.4.440.0170.06019.58
5.4.430.0200.05719.28
5.4.420.0230.05019.30
5.4.410.0200.05319.15
5.4.400.0200.05019.14
5.4.390.0230.04719.17
5.4.380.0200.06319.35
5.4.370.0100.05319.23
5.4.360.0170.05019.30
5.4.350.0130.05019.25
5.4.340.0130.05718.84
5.4.320.0200.05319.13
5.4.310.0170.05018.98
5.4.300.0100.05719.13
5.4.290.0200.05319.34
5.4.280.0300.04019.14
5.4.270.0170.05019.30
5.4.260.0130.05319.25
5.4.250.0270.04718.96
5.4.240.0300.04019.25
5.4.230.0230.07318.80
5.4.220.0170.05718.82
5.4.210.0070.06318.97
5.4.200.0330.06019.18
5.4.190.0130.06319.12
5.4.180.0170.05319.13
5.4.170.0130.05719.31
5.4.160.0200.05019.21
5.4.150.0200.05718.94
5.4.140.0200.05016.44
5.4.130.0270.06716.37
5.4.120.0100.06316.45
5.4.110.0100.06016.47
5.4.100.0170.05716.60
5.4.90.0300.03716.61
5.4.80.0170.06016.55
5.4.70.0130.05316.64
5.4.60.0130.05316.36
5.4.50.0100.05716.22
5.4.40.0370.05016.50
5.4.30.0170.05316.49
5.4.20.0170.05316.60
5.4.10.0130.05716.53
5.4.00.0170.05015.84

preferences:
59.89 ms | 401 KiB | 5 Q