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() use ($method) { return $this->package->$method; }; $f->bindTo($$this); return $f; } } } $salutationsInstance = new salutations(); $obj = new methodFactory($salutationsInstance); $hello = $obj->getPackageMethod('hello'); echo $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.0070.01416.63
8.3.50.0080.01121.16
8.3.40.0110.00718.82
8.3.30.0070.01118.69
8.3.20.0040.00420.16
8.3.10.0040.00423.65
8.3.00.0080.00018.05
8.2.180.0120.00318.29
8.2.170.0040.01122.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0070.00026.16
8.2.120.0080.00017.63
8.2.110.0060.00318.97
8.2.100.0120.00017.63
8.2.90.0060.00318.96
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0030.00621.18
8.2.30.0000.00720.52
8.2.20.0000.00717.63
8.2.10.0030.00517.95
8.2.00.0050.00217.99
8.1.280.0110.00725.92
8.1.270.0000.01523.87
8.1.260.0000.00726.35
8.1.250.0000.00928.09
8.1.240.0090.00023.88
8.1.230.0060.00617.79
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.00917.36
8.1.190.0000.00817.22
8.1.180.0050.00318.10
8.1.170.0080.00020.37
8.1.160.0050.00322.02
8.1.150.0000.00818.86
8.1.140.0040.00419.58
8.1.130.0040.00417.45
8.1.120.0040.00417.54
8.1.110.0040.00417.41
8.1.100.0040.00417.34
8.1.90.0070.00017.45
8.1.80.0000.00917.50
8.1.70.0020.00517.51
8.1.60.0000.00717.55
8.1.50.0060.00317.38
8.1.40.0000.00817.57
8.1.30.0060.00317.57
8.1.20.0040.00417.65
8.1.10.0040.00417.52
8.1.00.0040.00417.56
8.0.300.0000.00818.77
8.0.290.0000.00716.61
8.0.280.0030.00318.39
8.0.270.0060.00317.27
8.0.260.0030.00316.80
8.0.250.0040.00416.90
8.0.240.0040.00417.05
8.0.230.0040.00417.06
8.0.220.0000.00816.96
8.0.210.0000.00816.84
8.0.200.0030.00317.01
8.0.190.0000.00817.03
8.0.180.0040.00416.96
8.0.170.0040.00416.99
8.0.160.0000.00716.90
8.0.150.0070.00017.03
8.0.140.0000.00716.96
8.0.130.0000.00513.35
8.0.120.0080.00016.94
8.0.110.0090.00016.86
8.0.100.0040.00416.83
8.0.90.0000.00816.86
8.0.80.0120.00316.95
8.0.70.0070.00016.82
8.0.60.0000.00716.96
8.0.50.0070.00016.82
8.0.30.0100.00917.16
8.0.20.0070.01117.40
8.0.10.0050.00317.14
8.0.00.0070.00916.71
7.4.330.0000.00515.08
7.4.320.0000.00616.51
7.4.300.0030.00616.61
7.4.290.0050.00316.63
7.4.280.0060.00316.58
7.4.270.0070.00016.51
7.4.260.0000.00816.55
7.4.250.0000.00816.44
7.4.240.0020.00516.56
7.4.230.0040.00416.35
7.4.220.0060.01216.59
7.4.210.0000.01416.38
7.4.200.0030.00316.43
7.4.160.0090.00616.54
7.4.150.0130.00317.40
7.4.140.0140.01717.86
7.4.130.0090.00916.60
7.4.120.0170.00316.58
7.4.110.0170.00016.67
7.4.100.0130.01216.63
7.4.90.0000.01816.58
7.4.80.0080.00819.39
7.4.70.0080.01316.62
7.4.60.0090.00616.56
7.4.50.0050.00316.61
7.4.40.0140.00316.43
7.4.30.0090.00916.54
7.4.00.0030.01014.98
7.3.330.0000.00513.30
7.3.320.0030.00313.20
7.3.310.0040.00416.27
7.3.300.0040.00416.42
7.3.290.0050.01216.35
7.3.280.0100.00716.39
7.3.270.0060.01217.40
7.3.260.0120.01216.44
7.3.240.0080.01516.29
7.3.230.0160.00016.50
7.3.210.0060.01016.27
7.3.200.0060.01016.36
7.3.190.0090.00616.33
7.3.180.0060.01016.50
7.3.170.0060.01516.37
7.3.160.0130.00916.50
7.3.10.0000.01016.38
7.3.00.0090.00616.68
7.2.330.0070.01016.27
7.2.320.0030.01416.62
7.2.310.0090.00616.80
7.2.300.0080.00816.46
7.2.290.0230.00016.78
7.2.130.0080.00316.61
7.2.120.0000.01316.93
7.2.110.0060.00316.86
7.2.100.0040.00816.86
7.2.90.0100.00316.56
7.2.80.0100.00717.08
7.2.70.0060.00916.89
7.2.60.0070.00716.77
7.2.50.0030.00716.90
7.2.40.0030.00917.02
7.2.30.0060.00317.02
7.2.20.0100.00016.77
7.2.10.0110.00016.97
7.2.00.0020.01017.96
7.1.250.0060.00315.77
7.1.200.0000.01615.42
7.1.100.0000.00818.35
7.1.70.0080.00417.01
7.1.60.0060.01919.50
7.1.50.0000.01217.01
7.1.00.0030.07722.40
7.0.200.0030.00616.84
7.0.100.0400.08019.93
7.0.90.0430.06019.90
7.0.80.0430.07719.91
7.0.70.0300.08019.87
7.0.60.0430.07020.07
7.0.50.0500.03320.38
7.0.40.0130.08020.04
7.0.30.0100.08720.06
7.0.20.0070.07020.14
7.0.10.0100.07720.07
7.0.00.0130.08320.13
5.6.280.0070.07721.07
5.6.250.0130.07320.59
5.6.240.0030.08020.52
5.6.230.0100.04720.67
5.6.220.0100.07720.54
5.6.210.0170.07320.65
5.6.200.0070.06720.98
5.6.190.0170.06720.96
5.6.180.0170.04020.96
5.6.170.0170.04320.97
5.6.160.0100.08721.04
5.6.150.0200.04021.05
5.6.140.0200.07320.96
5.6.130.0130.07721.04
5.6.120.0100.08021.14
5.6.110.0030.05321.11
5.6.100.0070.08020.99
5.6.90.0030.05320.93
5.6.80.0070.07720.47
5.6.70.0100.05720.45
5.6.60.0030.07320.39
5.6.50.0030.05720.41
5.6.40.0070.03720.44
5.6.30.0000.04320.39
5.6.20.0130.03320.38
5.6.10.0070.03720.46
5.6.00.0000.04320.44
5.5.380.0130.07720.43
5.5.370.0100.07320.43
5.5.360.0100.05020.54
5.5.350.0030.06320.44
5.5.340.0130.07720.92
5.5.330.0170.07020.93
5.5.320.0130.08020.66
5.5.310.0070.05720.75
5.5.300.0100.08020.93
5.5.290.0130.07020.87
5.5.280.0100.06020.63
5.5.270.0070.06320.78
5.5.260.0100.07720.76
5.5.250.0130.05320.66
5.5.240.0070.07720.13
5.5.230.0100.07720.27
5.5.220.0100.04320.22
5.5.210.0130.07020.13
5.5.200.0070.04320.14
5.5.190.0070.03720.27
5.5.180.0000.04320.14
5.5.160.0070.03720.20
5.5.150.0070.03720.19
5.5.140.0030.04020.26
5.5.130.0070.03320.22
5.5.120.0070.03720.28
5.5.110.0070.04020.24
5.5.100.0070.07720.09
5.5.90.0070.07320.12
5.5.80.0030.07720.05
5.5.70.0070.06020.07
5.5.60.0030.03320.15
5.5.50.0070.04320.16
5.5.40.0000.04020.01
5.5.30.0100.03020.16
5.5.20.0070.03319.94
5.5.10.0070.03720.05
5.5.00.0070.03720.13
5.4.450.0170.06719.23
5.4.440.0100.07019.43
5.4.430.0170.07019.36
5.4.420.0030.06319.43
5.4.410.0200.06319.29
5.4.400.0130.06719.20
5.4.390.0030.05018.89
5.4.380.0000.08019.13
5.4.370.0030.05018.88
5.4.360.0030.04018.88
5.4.350.0000.04019.03
5.4.340.0030.05319.21
5.4.320.0130.03318.84
5.4.310.0030.05019.07
5.4.300.0070.03719.09
5.4.290.0000.04018.88
5.4.280.0070.04718.90
5.4.270.0100.04719.18
5.4.260.0030.03719.03
5.4.250.0070.06719.13
5.4.240.0100.06319.15
5.4.230.0070.04719.02
5.4.220.0000.04019.20
5.4.210.0000.04018.84
5.4.200.0070.06019.04
5.4.190.0070.04019.21
5.4.180.0000.04019.02
5.4.170.0070.04319.02
5.4.160.0030.04319.19
5.4.150.0030.04318.86
5.4.140.0070.03316.50
5.4.130.0070.02316.46
5.4.120.0070.03016.48
5.4.110.0130.03716.54
5.4.100.0070.03316.50
5.4.90.0000.03716.55
5.4.80.0170.02316.31
5.4.70.0100.02716.56
5.4.60.0070.03016.32
5.4.50.0030.03316.49
5.4.40.0000.03716.49
5.4.30.0030.03716.47
5.4.20.0030.03316.48
5.4.10.0030.03716.24
5.4.00.0030.03715.88

preferences:
67.71 ms | 401 KiB | 5 Q