3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { 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 { throw new BadFunctionCallException('You must a define a class to set as object.'); } } } $obj = new PHP; $obj->ObjInvoke();

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.0100.01016.88
8.3.50.0290.00521.93
8.3.40.0120.00318.70
8.3.30.0110.01118.73
8.3.20.0060.00320.16
8.3.10.0000.00823.61
8.3.00.0000.00819.38
8.2.180.0180.00018.54
8.2.170.0100.00322.96
8.2.160.0120.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00417.63
8.2.110.0060.00321.00
8.2.100.0130.00318.03
8.2.90.0080.00019.26
8.2.80.0040.00417.97
8.2.70.0060.00317.61
8.2.60.0050.00317.93
8.2.50.0030.00518.07
8.2.40.0000.00819.22
8.2.30.0000.00720.57
8.2.20.0040.00417.82
8.2.10.0040.00418.14
8.2.00.0000.00718.19
8.1.280.0070.00725.92
8.1.270.0120.00323.96
8.1.260.0020.00526.35
8.1.250.0000.00728.09
8.1.240.0000.00923.82
8.1.230.0110.00020.77
8.1.220.0080.00017.79
8.1.210.0090.00018.77
8.1.200.0090.00017.13
8.1.190.0040.00417.23
8.1.180.0050.00218.10
8.1.170.0080.00418.52
8.1.160.0050.00221.91
8.1.150.0000.00718.82
8.1.140.0030.00519.55
8.1.130.0030.00517.70
8.1.120.0000.00717.38
8.1.110.0040.00417.48
8.1.100.0080.00017.50
8.1.90.0040.00417.51
8.1.80.0040.00417.50
8.1.70.0070.00017.42
8.1.60.0030.00517.63
8.1.50.0040.00417.55
8.1.40.0030.00517.53
8.1.30.0000.00817.53
8.1.20.0030.00517.63
8.1.10.0040.00417.59
8.1.00.0000.00817.41
8.0.300.0050.00318.77
8.0.290.0040.00416.75
8.0.280.0040.00418.47
8.0.270.0000.00717.14
8.0.260.0000.00717.20
8.0.250.0000.00817.03
8.0.240.0070.00017.03
8.0.230.0040.00416.91
8.0.220.0070.00016.98
8.0.210.0040.00416.90
8.0.200.0000.00817.09
8.0.190.0030.00417.09
8.0.180.0050.00217.03
8.0.170.0030.00516.87
8.0.160.0050.00217.00
8.0.150.0040.00416.86
8.0.140.0070.00016.98
8.0.130.0030.00313.33
8.0.120.0000.01116.85
8.0.110.0000.00717.00
8.0.100.0030.00416.98
8.0.90.0040.00416.82
8.0.80.0070.00716.96
8.0.70.0040.00416.99
8.0.60.0000.00716.97
8.0.50.0000.00816.92
8.0.30.0060.01417.15
8.0.20.0120.00917.40
8.0.10.0040.00417.00
8.0.00.0070.01016.76
7.4.330.0050.00015.15
7.4.320.0030.00316.45
7.4.300.0040.00416.62
7.4.290.0040.00416.62
7.4.280.0040.00416.61
7.4.270.0040.00416.61
7.4.260.0000.00716.40
7.4.250.0000.00716.48
7.4.240.0050.00216.49
7.4.230.0030.00316.46
7.4.220.0000.01816.48
7.4.210.0070.01116.55
7.4.200.0050.00316.52
7.4.160.0140.00316.67
7.4.150.0090.01217.40
7.4.140.0100.01217.86
7.4.130.0140.00416.71
7.4.120.0090.00816.64
7.4.110.0150.00916.52
7.4.100.0140.00416.54
7.4.90.0030.01316.54
7.4.80.0090.00919.39
7.4.70.0060.00916.55
7.4.60.0000.01716.45
7.4.50.0040.00016.59
7.4.40.0070.01316.60
7.4.30.0090.01216.46
7.4.00.0030.01315.04
7.3.330.0050.00013.41
7.3.320.0050.00013.21
7.3.310.0000.00716.39
7.3.300.0040.00416.38
7.3.290.0070.00916.35
7.3.280.0080.00916.37
7.3.270.0140.00317.40
7.3.260.0060.01216.40
7.3.240.0070.01516.34
7.3.230.0090.00916.43
7.3.210.0130.00816.34
7.3.200.0100.00616.43
7.3.190.0080.00816.50
7.3.180.0100.00716.59
7.3.170.0000.02216.50
7.3.160.0040.01116.68
7.3.10.0090.00416.60
7.3.00.0160.00016.75
7.2.330.0150.00616.52
7.2.320.0100.01016.73
7.2.310.0000.01616.34
7.2.300.0060.01016.46
7.2.290.0120.00616.82
7.2.130.0060.00816.62
7.2.120.0000.01417.00
7.2.110.0140.00016.90
7.2.100.0040.00716.95
7.2.90.0000.01216.94
7.2.80.0130.00016.96
7.2.70.0030.01017.04
7.2.60.0030.01016.94
7.2.50.0040.01116.91
7.2.40.0030.01316.80
7.2.30.0000.00916.88
7.2.20.0000.01216.96
7.2.10.0040.00717.14
7.2.00.0040.01018.20
7.1.250.0070.00315.86
7.1.200.0110.00415.73
7.1.100.0060.00617.87
7.1.70.0050.00317.05
7.1.60.0070.01719.43
7.1.50.0070.01416.86
7.1.00.0070.07322.31
7.0.200.0030.00714.98
7.0.100.0030.09019.92
7.0.90.0070.07719.84
7.0.80.0070.08319.93
7.0.70.0070.06019.90
7.0.60.0030.04319.85
7.0.50.0100.08720.32
7.0.40.0100.08319.99
7.0.30.0100.08320.14
7.0.20.0070.08720.04
7.0.10.0100.08719.99
7.0.00.0070.08019.99
5.6.280.0000.03721.13
5.6.250.0230.07320.57
5.6.240.0070.08320.60
5.6.230.0070.08720.48
5.6.220.0100.08020.68
5.6.210.0030.08320.67
5.6.200.0100.06020.97
5.6.190.0070.08321.07
5.6.180.0070.08720.94
5.6.170.0030.08321.03
5.6.160.0100.08321.07
5.6.150.0030.08021.08
5.6.140.0100.08021.02
5.6.130.0030.08020.93
5.6.120.0100.07720.95
5.6.110.0070.08321.13
5.6.100.0030.09021.13
5.6.90.0030.07720.91
5.6.80.0130.07320.47
5.6.70.0170.07020.32
5.6.60.0070.08320.32
5.6.50.0100.07320.45
5.6.40.0030.06320.38
5.6.30.0170.06020.47
5.6.20.0100.05020.31
5.6.10.0030.08720.38
5.6.00.0070.08320.30
5.5.380.0130.07320.45
5.5.370.0070.08320.39
5.5.360.0030.09020.41
5.5.350.0030.07020.42
5.5.340.0070.08020.92
5.5.330.0030.07320.73
5.5.320.0000.08720.65
5.5.310.0070.06720.87
5.5.300.0100.07020.86
5.5.290.0130.07320.86
5.5.280.0100.07320.89
5.5.270.0030.08720.82
5.5.260.0100.07320.85
5.5.250.0030.09020.68
5.5.240.0100.07720.31
5.5.230.0030.08320.29
5.5.220.0100.07320.18
5.5.210.0130.06720.28
5.5.200.0200.06720.27
5.5.190.0030.05720.27
5.5.180.0100.04720.23
5.5.160.0070.06320.23
5.5.150.0100.07720.25
5.5.140.0000.08320.17
5.5.130.0130.06020.13
5.5.120.0000.05020.11
5.5.110.0070.05320.18
5.5.100.0130.07720.10
5.5.90.0100.07020.15
5.5.80.0100.03320.07
5.5.70.0100.07320.15
5.5.60.0170.05720.07
5.5.50.0070.07020.05
5.5.40.0070.08320.00
5.5.30.0100.06320.07
5.5.20.0300.03320.07
5.5.10.0070.04019.97
5.5.00.0100.06320.03
5.4.450.0030.09019.50
5.4.440.0100.05319.17
5.4.430.0100.07319.38
5.4.420.0070.08019.17
5.4.410.0200.07019.29
5.4.400.0070.08318.91
5.4.390.0070.08019.03
5.4.380.0030.08019.14
5.4.370.0170.06719.18
5.4.360.0100.06719.05
5.4.350.0030.08319.03
5.4.340.0330.03019.13
5.4.320.0100.04018.91
5.4.310.0130.07319.18
5.4.300.0130.06718.95
5.4.290.0100.07718.95
5.4.280.0070.06719.18
5.4.270.0070.04719.09
5.4.260.0070.07319.23
5.4.250.0070.04319.22
5.4.240.0100.04019.04
5.4.230.0000.08019.08
5.4.220.0100.03319.03
5.4.210.0030.04719.04
5.4.200.0030.08018.94
5.4.190.0070.04719.08
5.4.180.0130.06718.84
5.4.170.0070.08019.04
5.4.160.0070.04319.14
5.4.150.0000.04319.03
5.4.140.0100.04716.39
5.4.130.0000.07716.36
5.4.120.0100.05716.48
5.4.110.0070.06716.47
5.4.100.0030.04016.45
5.4.90.0030.07016.47
5.4.80.0100.03716.53
5.4.70.0030.08016.46
5.4.60.0000.05016.40
5.4.50.0130.06016.48
5.4.40.0070.07016.42
5.4.30.0000.06716.48
5.4.20.0170.06316.44
5.4.10.0100.07016.33
5.4.00.0100.07015.86

preferences:
36.2 ms | 401 KiB | 5 Q