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)) { return $this->package->$method(); } } } $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.70.0140.00318.43
8.3.60.0060.00916.88
8.3.50.0160.00821.99
8.3.40.0120.00919.02
8.3.30.0090.00918.84
8.3.20.0040.00420.16
8.3.10.0040.00421.90
8.3.00.0000.00818.05
8.2.190.0030.01416.58
8.2.180.0130.00918.54
8.2.170.0130.00722.96
8.2.160.0100.00320.30
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00317.63
8.2.110.0090.00019.24
8.2.100.0000.01217.91
8.2.90.0030.00619.27
8.2.80.0060.00317.97
8.2.70.0000.00917.50
8.2.60.0050.00217.90
8.2.50.0030.00518.07
8.2.40.0050.00321.08
8.2.30.0050.00320.74
8.2.20.0000.00717.66
8.2.10.0030.00517.85
8.2.00.0040.00418.02
8.1.280.0040.01125.92
8.1.270.0100.00623.91
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00619.34
8.1.230.0060.00617.66
8.1.220.0060.00317.74
8.1.210.0090.00018.77
8.1.200.0040.00417.35
8.1.190.0000.00817.35
8.1.180.0080.00018.10
8.1.170.0030.00620.30
8.1.160.0040.00421.86
8.1.150.0000.00818.81
8.1.140.0000.00919.55
8.1.130.0000.00717.62
8.1.120.0080.00017.39
8.1.110.0040.00417.46
8.1.100.0000.00817.39
8.1.90.0040.00417.38
8.1.80.0050.00317.31
8.1.70.0030.00317.31
8.1.60.0000.00717.60
8.1.50.0030.00517.58
8.1.40.0000.00817.56
8.1.30.0060.00317.61
8.1.20.0050.00217.50
8.1.10.0040.00417.64
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0050.00516.75
8.0.280.0000.00818.38
8.0.270.0060.00317.18
8.0.260.0030.00317.18
8.0.250.0040.00416.96
8.0.240.0080.00016.91
8.0.230.0030.00416.94
8.0.220.0070.00016.93
8.0.210.0030.00516.86
8.0.200.0000.00716.84
8.0.190.0050.00316.94
8.0.180.0000.00716.83
8.0.170.0040.00416.89
8.0.160.0070.00016.88
8.0.150.0000.00716.79
8.0.140.0040.00416.74
8.0.130.0000.00613.32
8.0.120.0040.00416.75
8.0.110.0000.00716.82
8.0.100.0000.00716.96
8.0.90.0000.00816.96
8.0.80.0070.01416.88
8.0.70.0000.00816.88
8.0.60.0040.00416.84
8.0.50.0040.00416.91
8.0.30.0090.01017.00
8.0.20.0100.00817.40
8.0.10.0000.00717.01
8.0.00.0090.01016.84
7.4.330.0000.00515.08
7.4.320.0030.00316.47
7.4.300.0070.00016.59
7.4.290.0000.00716.51
7.4.280.0000.01016.35
7.4.270.0070.00016.58
7.4.260.0030.00316.47
7.4.250.0070.00016.48
7.4.240.0060.00216.62
7.4.230.0030.00316.71
7.4.220.0110.00816.65
7.4.210.0100.01016.61
7.4.200.0000.00716.63
7.4.160.0080.00816.44
7.4.150.0030.01317.40
7.4.140.0090.01517.86
7.4.130.0130.01216.50
7.4.120.0090.00816.54
7.4.110.0120.00616.48
7.4.100.0110.01116.50
7.4.90.0070.01116.55
7.4.80.0090.00919.39
7.4.70.0100.00716.68
7.4.60.0070.01016.48
7.4.50.0000.00616.46
7.4.40.0170.00016.43
7.4.30.0060.01216.32
7.4.00.0000.01715.22
7.3.330.0020.00313.34
7.3.320.0060.00013.38
7.3.310.0040.00416.39
7.3.300.0040.00416.25
7.3.290.0080.00816.36
7.3.280.0090.00816.35
7.3.270.0090.00917.40
7.3.260.0140.00316.58
7.3.240.0090.00916.46
7.3.230.0090.00916.57
7.3.210.0130.00316.25
7.3.200.0130.00316.36
7.3.190.0100.00816.62
7.3.180.0120.00416.55
7.3.170.0100.00716.59
7.3.160.0100.00716.65
7.2.330.0060.01216.36
7.2.320.0170.01216.48
7.2.310.0060.01816.72
7.2.300.0080.00816.41
7.2.290.0090.01216.81
7.2.60.0060.00616.58
7.2.00.0090.00619.47
7.1.200.0100.00615.61
7.1.100.0090.00617.93
7.1.70.0070.01417.29
7.1.60.0160.00719.50
7.1.50.0070.01416.93
7.1.00.0100.07022.40
7.0.200.0090.00016.79
7.0.60.0070.06319.96
7.0.50.0030.06717.86
7.0.40.0100.05320.18
7.0.30.0300.07720.21
7.0.20.0270.08020.26
7.0.10.0070.08720.16
7.0.00.0130.07320.06
5.6.280.0000.05721.02
5.6.210.0100.06720.49
5.6.200.0100.07718.18
5.6.190.0000.05020.49
5.6.180.0130.05320.61
5.6.170.0300.08020.57
5.6.160.0030.07720.71
5.6.150.0070.03718.20
5.6.140.0130.08018.28
5.6.130.0030.08318.24
5.6.120.0070.05720.88
5.6.110.0000.04321.05
5.6.100.0170.08021.00
5.6.90.0070.08720.95
5.6.80.0070.04720.38
5.5.350.0030.08020.31
5.5.340.0030.06318.08
5.5.330.0200.07320.27
5.5.320.3570.04320.30
5.5.310.0300.07320.37
5.5.300.0070.06017.97
5.5.290.0100.07717.94
5.5.280.0070.08720.78
5.5.270.0070.08020.76
5.5.260.0100.07720.80
5.5.250.0070.05320.47
5.5.240.0000.09020.16
5.4.450.0170.05319.59
5.4.440.0130.06319.30
5.4.430.0230.05319.62
5.4.420.0170.06719.13
5.4.410.0300.04719.04
5.4.400.0430.04319.26
5.4.390.0230.05719.13
5.4.380.0270.04318.99
5.4.370.0100.06019.14
5.4.360.0300.04319.25
5.4.350.0300.04019.23
5.4.340.0230.04719.11
5.4.320.0100.05318.98
5.4.310.0300.05019.13
5.4.300.0330.04718.97
5.4.290.0170.05019.25
5.4.280.0170.05319.02
5.4.270.0200.04719.14
5.4.260.0130.05018.98
5.4.250.0070.05719.13
5.4.240.0270.07019.08
5.4.230.0200.04319.13
5.4.220.0170.05318.84
5.4.210.0270.04718.80
5.4.200.0170.05019.19
5.4.190.0130.06019.25
5.4.180.0200.05018.96
5.4.170.0170.05718.93
5.4.160.0200.05019.27
5.4.150.0300.05719.00
5.4.140.0600.05316.55
5.4.130.0630.05716.33
5.4.120.0700.04316.58
5.4.110.0700.04716.48
5.4.100.0730.04316.44
5.4.90.0670.04316.61
5.4.80.0730.04316.57
5.4.70.0330.05316.65
5.4.60.0100.05316.59
5.4.50.0530.05316.42
5.4.40.0570.05716.48
5.4.30.0770.04316.61
5.4.20.0700.05016.43
5.4.10.0630.04316.23
5.4.00.0470.05016.00

preferences:
48.7 ms | 401 KiB | 5 Q