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->package->$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.0090.00617.00
8.3.50.0140.01421.11
8.3.40.0140.00418.71
8.3.30.0040.01119.02
8.3.20.0050.00320.05
8.3.10.0050.00321.90
8.3.00.0060.00317.89
8.2.180.0040.01118.55
8.2.170.0090.01222.96
8.2.160.0030.01020.57
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00417.63
8.2.110.0000.01120.38
8.2.100.0040.00817.80
8.2.90.0050.00319.00
8.2.80.0030.00517.97
8.2.70.0030.00617.50
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0030.00520.92
8.2.30.0000.00720.63
8.2.20.0000.00817.76
8.2.10.0000.00918.00
8.2.00.0040.00417.98
8.1.280.0100.00725.92
8.1.270.0040.00423.82
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0000.00822.65
8.1.230.0060.00617.66
8.1.220.0050.00317.79
8.1.210.0030.00518.77
8.1.200.0060.00317.38
8.1.190.0060.00317.22
8.1.180.0050.00318.10
8.1.170.0030.00520.30
8.1.160.0000.00722.10
8.1.150.0000.00818.83
8.1.140.0040.00419.59
8.1.130.0060.00317.77
8.1.120.0000.00717.40
8.1.110.0040.00417.49
8.1.100.0040.00417.43
8.1.90.0040.00317.45
8.1.80.0030.00617.45
8.1.70.0000.00717.51
8.1.60.0040.00417.57
8.1.50.0060.00317.53
8.1.40.0040.00417.51
8.1.30.0090.00017.53
8.1.20.0030.00617.64
8.1.10.0000.00717.66
8.1.00.0080.00017.55
8.0.300.0050.00318.77
8.0.290.0020.00516.75
8.0.280.0000.00718.43
8.0.270.0090.00017.21
8.0.260.0030.00317.17
8.0.250.0000.00817.03
8.0.240.0050.00316.99
8.0.230.0000.00716.92
8.0.220.0000.00716.92
8.0.210.0000.00716.73
8.0.200.0030.00317.07
8.0.190.0040.00417.03
8.0.180.0040.00416.97
8.0.170.0030.00617.05
8.0.160.0080.00016.97
8.0.150.0000.00716.93
8.0.140.0000.00816.88
8.0.130.0050.00013.36
8.0.120.0050.00516.92
8.0.110.0040.00417.04
8.0.100.0050.00316.76
8.0.90.0000.00716.79
8.0.80.0100.01116.90
8.0.70.0040.00416.95
8.0.60.0000.00817.08
8.0.50.0000.00817.02
8.0.30.0130.00317.06
8.0.20.0100.00817.40
8.0.10.0000.00716.97
8.0.00.0110.00816.68
7.4.330.0000.00515.08
7.4.320.0070.00016.52
7.4.300.0060.00316.49
7.4.290.0030.00316.63
7.4.280.0060.00316.50
7.4.270.0070.00016.50
7.4.260.0070.00016.48
7.4.250.0070.00016.45
7.4.240.0040.00316.48
7.4.230.0000.00716.54
7.4.220.0150.00416.63
7.4.210.0070.00716.59
7.4.200.0040.00316.51
7.4.160.0140.00716.58
7.4.150.0090.01517.40
7.4.140.0160.01617.86
7.4.130.0100.00716.40
7.4.120.0150.00616.59
7.4.110.0040.01416.54
7.4.100.0030.02116.70
7.4.90.0060.01216.56
7.4.80.0030.01419.39
7.4.70.0060.01316.51
7.4.60.0070.01016.32
7.4.50.0030.00316.38
7.4.40.0060.01216.27
7.4.30.0060.01116.45
7.4.00.0060.00914.75
7.3.330.0000.00613.39
7.3.320.0050.00013.33
7.3.310.0000.00816.38
7.3.300.0070.00016.34
7.3.290.0080.01116.34
7.3.280.0090.00816.35
7.3.270.0110.00717.40
7.3.260.0090.00916.42
7.3.240.0070.01116.40
7.3.230.0070.01016.39
7.3.210.0030.01316.34
7.3.200.0030.01216.36
7.3.190.0060.00916.44
7.3.180.0060.01016.59
7.3.170.0060.00916.53
7.3.160.0100.00716.41
7.2.330.0140.00416.42
7.2.320.0070.01316.35
7.2.310.0090.00616.44
7.2.300.0090.00916.34
7.2.290.0170.00516.70
7.2.60.0230.00416.53
7.2.00.0120.00019.12
7.1.200.0000.01215.54
7.1.100.0000.01117.97
7.1.70.0110.00817.20
7.1.60.0060.01919.50
7.1.50.0100.01016.85
7.1.00.0030.07722.46
7.0.200.0070.00316.48
7.0.60.0100.07320.00
7.0.50.0030.04017.86
7.0.40.0030.09320.25
7.0.30.0270.04320.23
7.0.20.0200.06720.30
7.0.10.0100.07720.07
7.0.00.0070.04020.05
5.6.280.0030.07021.14
5.6.210.0170.07720.67
5.6.200.0030.04018.16
5.6.190.0000.07320.55
5.6.180.0400.04020.68
5.6.170.0230.07320.47
5.6.160.0100.08320.50
5.6.150.0100.08018.27
5.6.140.0100.08018.15
5.6.130.0000.08718.26
5.6.120.0030.04021.02
5.6.110.0070.06321.14
5.6.100.0100.06021.02
5.6.90.0130.07320.98
5.6.80.0100.06720.39
5.5.350.0030.04020.33
5.5.340.0030.08717.93
5.5.330.0070.04020.47
5.5.320.3100.05020.27
5.5.310.0200.06020.41
5.5.300.0000.05718.01
5.5.290.0100.08317.95
5.5.280.0070.03720.99
5.5.270.0230.06320.90
5.5.260.0030.04020.76
5.5.250.0000.06720.51
5.5.240.0000.08020.27
5.4.450.0700.06319.35
5.4.440.0670.06719.57
5.4.430.0730.04719.57
5.4.420.0700.05319.28
5.4.410.0670.05319.40
5.4.400.0670.05319.14
5.4.390.0700.05019.13
5.4.380.0630.05719.23
5.4.370.0600.06018.80
5.4.360.0770.04719.25
5.4.350.0700.04719.19
5.4.340.0800.04319.13
5.4.320.0770.04718.81
5.4.310.0670.04718.98
5.4.300.0670.05719.34
5.4.290.0630.06018.80
5.4.280.0670.06019.13
5.4.270.0670.05719.25
5.4.260.0700.04719.13
5.4.250.0630.06019.23
5.4.240.0700.05019.18
5.4.230.0770.04719.20
5.4.220.0730.04718.80
5.4.210.0670.05719.17
5.4.200.0670.05019.12
5.4.190.0670.05718.82
5.4.180.0670.05718.95
5.4.170.0870.05719.10
5.4.160.0670.05019.12
5.4.150.0630.05719.16
5.4.140.0770.06016.77
5.4.130.0830.05316.33
5.4.120.0630.05016.58
5.4.110.0770.04316.47
5.4.100.0630.05016.48
5.4.90.0630.04716.66
5.4.80.0830.04316.46
5.4.70.0670.05316.21
5.4.60.0600.05716.58
5.4.50.0700.04316.16
5.4.40.0570.05716.59
5.4.30.0670.06716.58
5.4.20.0800.06316.57
5.4.10.0670.05716.57
5.4.00.0700.05015.95

preferences:
46.46 ms | 401 KiB | 5 Q