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'); $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.63
8.3.50.0060.01221.28
8.3.40.0070.00718.74
8.3.30.0090.00618.84
8.3.20.0080.00020.21
8.3.10.0080.00023.48
8.3.00.0000.00819.56
8.2.180.0100.01016.48
8.2.170.0150.00022.96
8.2.160.0130.00320.35
8.2.150.0020.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00417.63
8.2.110.0000.01020.35
8.2.100.0000.01218.03
8.2.90.0030.00619.25
8.2.80.0080.00017.97
8.2.70.0000.00817.75
8.2.60.0060.00617.91
8.2.50.0030.00518.07
8.2.40.0040.00421.07
8.2.30.0040.00420.64
8.2.20.0050.00317.77
8.2.10.0060.00318.14
8.2.00.0040.00417.98
8.1.280.0140.00725.92
8.1.270.0140.00323.96
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.53
8.1.230.0070.00417.54
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0110.00017.23
8.1.190.0000.00817.25
8.1.180.0060.00318.10
8.1.170.0040.00420.32
8.1.160.0070.00021.95
8.1.150.0000.00718.90
8.1.140.0040.00419.47
8.1.130.0000.00717.71
8.1.120.0040.00417.51
8.1.110.0040.00417.32
8.1.100.0030.00517.48
8.1.90.0070.00017.55
8.1.80.0000.00817.48
8.1.70.0000.00817.48
8.1.60.0000.00717.58
8.1.50.0000.00817.42
8.1.40.0050.00317.41
8.1.30.0050.00317.70
8.1.20.0000.00817.71
8.1.10.0040.00417.47
8.1.00.0050.00317.54
8.0.300.0040.00418.77
8.0.290.0000.00716.73
8.0.280.0000.00818.37
8.0.270.0040.00417.25
8.0.260.0000.00617.27
8.0.250.0040.00417.07
8.0.240.0040.00416.95
8.0.230.0040.00417.04
8.0.220.0040.00416.86
8.0.210.0070.00016.97
8.0.200.0000.00717.08
8.0.190.0040.00417.01
8.0.180.0000.00716.88
8.0.170.0090.00017.02
8.0.160.0040.00417.06
8.0.150.0000.00716.90
8.0.140.0040.00416.81
8.0.130.0030.00313.43
8.0.120.0000.00816.99
8.0.110.0040.00416.93
8.0.100.0040.00416.83
8.0.90.0030.00316.79
8.0.80.0130.00316.96
8.0.70.0040.00417.03
8.0.60.0000.00816.98
8.0.50.0030.00516.83
8.0.30.0150.00417.03
8.0.20.0100.01017.40
8.0.10.0000.00717.06
8.0.00.0090.01216.82
7.4.330.0030.00315.08
7.4.320.0020.00516.59
7.4.300.0030.00616.43
7.4.290.0000.00716.54
7.4.280.0030.00716.63
7.4.270.0000.00716.63
7.4.260.0000.00716.57
7.4.250.0040.00416.57
7.4.240.0040.00416.51
7.4.230.0040.00416.68
7.4.220.0080.01116.64
7.4.210.0090.00616.53
7.4.200.0030.00316.39
7.4.160.0110.00616.49
7.4.150.0110.00617.40
7.4.140.0110.00717.86
7.4.130.0140.01016.63
7.4.120.0070.01216.46
7.4.110.0150.00916.27
7.4.100.0130.00316.52
7.4.90.0060.01116.66
7.4.80.0060.01419.39
7.4.70.0120.00616.56
7.4.60.0030.01316.68
7.4.50.0040.00416.74
7.4.40.0190.00316.35
7.4.30.0100.00716.54
7.4.00.0070.00714.95
7.3.330.0020.00313.30
7.3.320.0050.00013.24
7.3.310.0000.00716.39
7.3.300.0040.00316.18
7.3.290.0050.01116.33
7.3.280.0090.00916.38
7.3.270.0120.00917.40
7.3.260.0100.01416.63
7.3.240.0110.00816.53
7.3.230.0040.01516.39
7.3.210.0050.01116.60
7.3.200.0060.01216.39
7.3.190.0130.00316.29
7.3.180.0100.00616.51
7.3.170.0150.00616.45
7.3.160.0120.00616.41
7.2.330.0110.00516.71
7.2.320.0130.00516.72
7.2.310.0060.00916.75
7.2.300.0070.01016.77
7.2.290.0080.01116.57
7.2.60.0070.00716.80
7.1.200.0060.00615.79
7.1.70.0000.01017.13
7.1.60.0070.01417.09
7.1.50.0090.00617.00
7.1.00.0000.08022.31
7.0.200.0070.00016.81
7.0.60.0100.05719.90
7.0.50.0000.04317.97
7.0.40.0130.07020.23
7.0.30.0330.07320.26
7.0.20.0170.04020.15
7.0.10.0070.08320.28
7.0.00.0030.05020.32
5.6.280.0070.03320.94
5.6.210.0130.07320.70
5.6.200.0170.04018.15
5.6.190.0070.06720.41
5.6.180.0270.07020.33
5.6.170.0330.04720.51
5.6.160.0070.08720.51
5.6.150.0100.07018.18
5.6.140.0030.08718.18
5.6.130.0170.07018.16
5.6.120.0030.04721.07
5.6.110.0100.08321.16
5.6.100.0100.08021.02
5.6.90.0000.07321.12
5.6.80.0100.08020.37
5.5.350.0000.03720.39
5.5.340.0100.07717.93
5.5.330.0030.04720.41
5.5.320.3500.04020.33
5.5.310.0270.05320.31
5.5.300.0100.04017.98
5.5.290.0070.08717.98
5.5.280.0030.04020.78
5.5.270.0130.08020.84
5.5.260.0130.06020.80
5.5.250.0000.05720.70
5.5.240.0000.07720.38
5.4.450.0230.08019.57
5.4.440.0300.07719.28
5.4.430.0170.08319.12
5.4.420.0370.06319.57
5.4.410.0230.07719.47
5.4.400.0200.07018.83
5.4.390.0130.08019.25
5.4.380.0100.06019.20
5.4.370.0070.06318.96
5.4.360.0200.06318.79
5.4.350.0370.06019.07
5.4.340.0270.05719.20
5.4.320.0270.05318.91
5.4.310.0400.05018.91
5.4.300.0400.06019.20
5.4.290.0130.08719.27
5.4.280.0300.06019.24
5.4.270.0270.05319.07
5.4.260.0300.06019.07
5.4.250.0300.05319.23
5.4.240.0330.03719.05
5.4.230.0370.03719.05
5.4.220.0200.05319.23
5.4.210.0130.06018.91
5.4.200.0300.03719.08
5.4.190.0230.04719.24
5.4.180.0200.04719.07
5.4.170.0170.05019.06
5.4.160.0200.05019.06
5.4.150.0300.07718.89
5.4.140.0170.07016.41
5.4.130.0230.04316.36
5.4.120.0170.05016.36
5.4.110.0230.04316.63
5.4.100.0270.05716.63
5.4.90.0230.05016.44
5.4.80.0170.05016.64
5.4.70.0100.05716.48
5.4.60.0230.04716.14
5.4.50.0270.04716.38
5.4.40.0300.05716.44
5.4.30.0400.04316.45
5.4.20.0230.07016.35
5.4.10.0270.05016.22
5.4.00.0200.05315.76

preferences:
32.52 ms | 401 KiB | 5 Q