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; }; $f->bindTo($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.0110.00418.09
8.3.40.0140.00418.81
8.3.30.0070.01118.71
8.3.20.0000.00820.21
8.3.10.0060.00323.61
8.3.00.0040.00417.75
8.2.180.0140.00416.75
8.2.170.0070.00722.96
8.2.160.0070.00720.35
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00017.38
8.2.110.0040.00721.03
8.2.100.0070.00417.85
8.2.90.0050.00318.28
8.2.80.0000.00817.97
8.2.70.0030.00617.48
8.2.60.0080.00017.80
8.2.50.0060.00318.07
8.2.40.0060.00321.11
8.2.30.0070.00020.55
8.2.20.0000.00817.75
8.2.10.0040.00418.07
8.2.00.0000.00718.07
8.1.280.0070.00725.92
8.1.270.0110.00723.97
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00024.00
8.1.230.0030.00920.97
8.1.220.0000.00817.74
8.1.210.0090.00020.30
8.1.200.0100.00017.35
8.1.190.0090.00019.13
8.1.180.0050.00318.10
8.1.170.0030.00520.42
8.1.160.0000.00721.96
8.1.150.0000.00818.90
8.1.140.0050.00321.40
8.1.130.0030.00317.70
8.1.120.0080.00017.37
8.1.110.0000.00817.45
8.1.100.0050.00217.43
8.1.90.0040.00417.42
8.1.80.0050.00317.52
8.1.70.0030.00517.36
8.1.60.0040.00417.61
8.1.50.0000.00717.53
8.1.40.0080.00017.54
8.1.30.0000.00817.71
8.1.20.0040.00417.55
8.1.10.0040.00417.60
8.1.00.0040.00417.56
8.0.300.0030.00520.13
8.0.290.0030.00616.63
8.0.280.0030.00318.41
8.0.270.0040.00417.14
8.0.260.0030.00317.27
8.0.250.0040.00416.99
8.0.240.0040.00416.91
8.0.230.0050.00216.96
8.0.220.0070.00016.95
8.0.210.0000.00816.89
8.0.200.0000.00617.03
8.0.190.0040.00417.09
8.0.180.0000.00717.00
8.0.170.0000.00817.05
8.0.160.0040.00416.87
8.0.150.0000.00716.81
8.0.140.0050.00316.84
8.0.130.0050.00013.39
8.0.120.0060.00316.86
8.0.110.0040.00416.88
8.0.100.0000.00716.85
8.0.90.0070.00016.96
8.0.80.0000.01516.92
8.0.70.0040.00416.98
8.0.60.0040.00416.84
8.0.50.0040.00416.81
8.0.30.0150.00317.05
8.0.20.0110.00817.40
8.0.10.0000.00717.03
8.0.00.0130.00716.80
7.4.330.0000.00615.15
7.4.320.0000.00616.51
7.4.300.0090.00016.50
7.4.290.0080.00016.54
7.4.280.0060.00316.54
7.4.270.0050.00316.63
7.4.260.0050.00316.49
7.4.250.0040.00416.44
7.4.240.0050.00216.49
7.4.230.0050.00316.40
7.4.220.0160.00616.62
7.4.210.0000.01416.56
7.4.200.0000.00716.64
7.4.160.0080.00816.51
7.4.150.0070.01017.40
7.4.140.0150.00717.86
7.4.130.0080.00816.50
7.4.120.0160.00816.48
7.4.110.0070.01616.52
7.4.100.0070.01316.66
7.4.90.0040.01316.51
7.4.80.0090.01119.39
7.4.70.0120.00616.58
7.4.60.0030.01316.60
7.4.50.0040.00416.44
7.4.40.0060.00916.38
7.4.30.0070.01716.76
7.4.00.0070.01115.27
7.3.330.0060.00013.44
7.3.320.0060.00013.24
7.3.310.0000.00716.48
7.3.300.0030.00316.34
7.3.290.0060.01116.31
7.3.280.0090.00916.35
7.3.270.0070.01017.40
7.3.260.0200.00316.41
7.3.240.0160.00716.54
7.3.230.0070.01016.50
7.3.210.0080.00816.50
7.3.200.0120.00416.56
7.3.190.0100.01016.45
7.3.180.0090.00616.37
7.3.170.0140.00716.56
7.3.160.0110.00616.42
7.2.330.0070.01316.75
7.2.320.0160.00716.43
7.2.310.0120.00316.66
7.2.300.0060.01216.86
7.2.290.0030.01316.71
7.2.60.0180.00316.97
7.2.00.0000.01419.38
7.1.200.0030.00715.57
7.1.100.0040.00818.37
7.1.70.0070.00517.22
7.1.60.0070.01719.50
7.1.50.0060.01616.81
7.1.00.0030.07722.45
7.0.200.0070.00716.70
7.0.60.0070.07719.93
7.0.50.0070.08017.97
7.0.40.0170.07320.14
7.0.30.0330.07320.15
7.0.20.0300.07020.07
7.0.10.0130.06720.33
7.0.00.0070.08320.25
5.6.280.0000.03320.83
5.6.210.0130.06720.64
5.6.200.0100.04018.19
5.6.190.0030.06720.46
5.6.180.0270.05320.61
5.6.170.0330.04320.48
5.6.160.0130.07020.51
5.6.150.0030.06318.28
5.6.140.0130.07318.18
5.6.130.0030.08718.20
5.6.120.0170.05321.01
5.6.110.0200.07321.04
5.6.100.0030.07320.99
5.6.90.0230.06721.03
5.6.80.0100.06320.52
5.5.350.0030.08020.45
5.5.340.0030.03717.93
5.5.330.0100.08320.13
5.5.320.2900.04720.36
5.5.310.0270.07720.28
5.5.300.0100.05718.04
5.5.290.0070.08318.06
5.5.280.0130.07720.86
5.5.270.0070.03720.88
5.5.260.0130.07720.98
5.5.250.0100.06320.59
5.5.240.0100.07020.25
5.4.450.0270.04719.32
5.4.440.0330.07319.47
5.4.430.0200.04319.54
5.4.420.0400.06319.46
5.4.410.0230.04019.34
5.4.400.0230.04019.09
5.4.390.0300.03719.08
5.4.380.0400.04319.11
5.4.370.0230.05318.88
5.4.360.0430.05019.06
5.4.350.0170.03718.89
5.4.340.0130.04019.06
5.4.320.0330.02319.00
5.4.310.0170.03719.06
5.4.300.0100.04319.21
5.4.290.0170.03719.16
5.4.280.0070.05318.98
5.4.270.0230.04019.09
5.4.260.0230.03719.08
5.4.250.0230.03719.19
5.4.240.0270.03019.23
5.4.230.0130.04019.15
5.4.220.0200.04018.88
5.4.210.0130.04019.06
5.4.200.0130.04019.14
5.4.190.0300.03318.84
5.4.180.0200.03719.18
5.4.170.0230.03019.29
5.4.160.0200.03719.14
5.4.150.0200.03718.96
5.4.140.0170.04016.40
5.4.130.0200.03716.55
5.4.120.0230.05316.56
5.4.110.0230.06716.30
5.4.100.0270.06316.32
5.4.90.0230.04316.64

preferences:
54.4 ms | 400 KiB | 5 Q