3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $foo; public function __construct($foo) { $this->foo = $foo; } public function foo() { return $this->foo; } public function Hello() { return 'Hello World!'; } } class PHP { public function ObjInvoke(...$args) { if(isset($args[0]) && !empty($args[0])) { $class = $args[0]; $string = '$obj = new '.$class; if(isset($args[1])) { $arguments = array_shift(array_shift($args)); $string .= '('.$args[1]; foreach($arguments as $arg) { $string .= ', '.$arg; } $string .= ')'; } $string .= ';'; echo($string); } else { print('You must a define a class to set as object.'); } } } $obj = new PHP; $obj->ObjInvoke('A', 'bar');

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.0120.00618.68
8.3.60.0130.01016.48
8.3.50.0140.00821.99
8.3.40.0070.00718.98
8.3.30.0000.02118.85
8.3.20.0150.00022.13
8.3.10.0040.00423.70
8.3.00.0080.00019.26
8.2.180.0090.00918.29
8.2.170.0110.00422.96
8.2.160.0000.01320.39
8.2.150.0110.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0070.00417.75
8.2.110.0040.00719.39
8.2.100.0120.00417.77
8.2.90.0000.00919.39
8.2.80.0040.00417.97
8.2.70.0060.00317.73
8.2.60.0050.00318.00
8.2.50.0000.00818.07
8.2.40.0030.00519.36
8.2.30.0000.00920.72
8.2.20.0000.00817.72
8.2.10.0000.00718.18
8.2.00.0000.00718.07
8.1.280.0090.00625.92
8.1.270.0080.00023.88
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.84
8.1.230.0090.00318.99
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0030.00718.64
8.1.160.0000.00722.03
8.1.150.0000.00718.91
8.1.140.0050.00319.65
8.1.130.0030.00317.72
8.1.120.0040.00417.36
8.1.110.0030.00317.50
8.1.100.0030.00517.49
8.1.90.0040.00417.53
8.1.80.0030.00617.50
8.1.70.0050.00317.51
8.1.60.0000.00817.50
8.1.50.0080.00017.46
8.1.40.0030.00617.58
8.1.30.0040.00417.59
8.1.20.0040.00417.68
8.1.10.0040.00417.59
8.1.00.0050.00217.43
8.0.300.0040.00418.77
8.0.290.0030.00516.75
8.0.280.0030.00318.42
8.0.270.0000.00717.21
8.0.260.0030.00317.30
8.0.250.0070.00016.94
8.0.240.0070.00016.90
8.0.230.0080.00316.93
8.0.220.0000.00716.97
8.0.210.0000.00716.96
8.0.200.0000.00716.92
8.0.190.0000.00917.02
8.0.180.0000.00716.89
8.0.170.0050.00516.99
8.0.160.0040.00416.89
8.0.150.0050.00316.90
8.0.140.0000.00716.93
8.0.130.0030.00313.48
8.0.120.0080.00016.96
8.0.110.0040.00416.96
8.0.100.0040.00417.10
8.0.90.0000.00716.88
8.0.80.0060.00916.98
8.0.70.0040.00416.88
8.0.60.0080.00016.95
8.0.50.0040.00417.08
8.0.30.0090.01116.92
8.0.20.0150.00317.40
8.0.10.0040.00417.11
8.0.00.0120.00716.97
7.4.330.0000.00515.08
7.4.320.0000.00716.40
7.4.300.0030.00316.53
7.4.290.0000.00716.55
7.4.280.0050.00216.64
7.4.270.0050.00316.50
7.4.260.0000.00716.63
7.4.250.0000.00816.58
7.4.240.0040.00316.59
7.4.230.0040.00416.43
7.4.220.0030.01416.44
7.4.210.0070.00716.50
7.4.200.0050.00216.34
7.4.160.0070.01016.54
7.4.150.0030.01617.40
7.4.140.0140.01117.86
7.4.130.0170.00716.61
7.4.120.0080.01116.53
7.4.110.0170.00316.58
7.4.100.0090.00916.45
7.4.90.0080.00816.38
7.4.80.0110.00819.39
7.4.70.0090.00916.45
7.4.60.0030.01316.69
7.4.50.0000.00516.45
7.4.40.0030.01416.36
7.4.30.0120.00616.48
7.4.00.0030.00615.11
7.3.330.0060.00013.40
7.3.320.0000.00613.31
7.3.310.0070.00016.49
7.3.300.0030.00316.39
7.3.290.0050.01116.34
7.3.280.0080.00616.39
7.3.270.0070.01017.40
7.3.260.0060.01216.45
7.3.240.0130.00616.40
7.3.230.0130.01016.68
7.3.210.0090.00916.67
7.3.200.0070.01016.39
7.3.190.0070.01016.67
7.3.180.0040.01616.38
7.3.170.0130.01016.37
7.3.160.0090.00616.39
7.2.330.0130.00416.72
7.2.320.0100.00716.88
7.2.310.0130.00316.84
7.2.300.0110.00816.52
7.2.290.0150.00316.81
7.2.60.0060.00616.93
7.1.200.0040.00415.46
7.1.70.0000.01417.30
7.1.60.0090.01219.43
7.1.50.0070.01416.89
7.1.00.0000.08022.45
7.0.200.0050.00514.95
7.0.60.0070.05719.91
7.0.50.0000.04317.84
7.0.40.0230.07020.24
7.0.30.0530.05020.17
7.0.20.0330.04720.18
7.0.10.0030.06020.22
7.0.00.0030.04720.14
5.6.280.0070.05020.91
5.6.210.0070.08720.63
5.6.200.0100.05318.14
5.6.190.0070.05720.56
5.6.180.0300.06320.55
5.6.170.0300.08020.55
5.6.160.0000.07720.50
5.6.150.0000.04318.22
5.6.140.0000.09018.23
5.6.130.0000.07018.28
5.6.120.0100.08021.04
5.6.110.0070.08321.00
5.6.100.0070.07020.98
5.6.90.0030.04721.14
5.6.80.0070.04320.43
5.5.350.0300.07720.47
5.5.340.0100.07718.05
5.5.330.0030.06320.27
5.5.320.0170.04320.34
5.5.310.0270.03720.30
5.5.300.0030.07017.94
5.5.290.0100.07717.99
5.5.280.0130.07720.88
5.5.270.0070.05720.96
5.5.260.0070.07020.73
5.5.250.0070.06320.59
5.5.240.0030.04020.29
5.4.450.0200.08319.38
5.4.440.0270.07019.48
5.4.430.0200.06319.45
5.4.420.0300.06719.59
5.4.410.0170.05719.39
5.4.400.0170.05719.16
5.4.390.0270.06319.15
5.4.380.0200.06719.25
5.4.370.0130.07319.27
5.4.360.0170.08019.26
5.4.350.0170.07719.36
5.4.340.0270.04319.21
5.4.320.0270.07019.27
5.4.310.0330.04718.84
5.4.300.0270.04719.26
5.4.290.0070.06319.21
5.4.280.0130.06319.12
5.4.270.0300.05719.23
5.4.260.0230.06319.14
5.4.250.0170.06318.83
5.4.240.0330.05719.15
5.4.230.0370.05719.27
5.4.220.0200.06719.29
5.4.210.0170.08019.14
5.4.200.0270.04319.14
5.4.190.0100.06319.16
5.4.180.0130.05719.04
5.4.170.0170.06019.11
5.4.160.0200.06318.98
5.4.150.0130.06018.81
5.4.140.0170.05316.52
5.4.130.0170.05316.37
5.4.120.0200.05016.60
5.4.110.0300.06316.64
5.4.100.0270.04716.57
5.4.90.0200.05716.23
5.4.80.0200.05016.55
5.4.70.0270.04316.29
5.4.60.0170.05016.16
5.4.50.0330.04016.59
5.4.40.0230.05316.60
5.4.30.0370.05016.25
5.4.20.0300.03716.50
5.4.10.0230.06316.58
5.4.00.0130.05715.85

preferences:
60.1 ms | 401 KiB | 5 Q