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!'; } } function PHP(...$args) { if(isset($args[0]) && !empty($args[0])) { $class = $args[0]; if(class_exists($class)) { $string = '$obj = new '.$class; if(isset($args[1])) { $arguments = $args; $string .= '('.$args[1]; array_shift($arguments); array_shift($arguments); foreach($arguments as $arg) { if(is_string($arg)) { $string .= ', \''.$arg.'\''; } else { $string .= ', '.$arg; } } $string .= ')'; } $string .= ';'; eval($string); return $obj; } else { print('This class do not exists.'); } } else { print('You must a define a class to set as object.'); } } $obj = PHP('A', 'foo'); echo($obj->foo());

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.0110.01116.63
8.3.50.0100.01222.06
8.3.40.0140.00018.88
8.3.30.0090.00618.79
8.3.20.0040.00420.38
8.3.10.0080.00023.53
8.3.00.0000.00819.63
8.2.180.0120.00918.54
8.2.170.0140.00022.96
8.2.160.0100.00320.47
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.01317.63
8.2.110.0060.00319.45
8.2.100.0090.00317.91
8.2.90.0000.00817.88
8.2.80.0080.00018.77
8.2.70.0090.00017.75
8.2.60.0000.00817.75
8.2.50.0040.00418.18
8.2.40.0000.00819.88
8.2.30.0050.00320.63
8.2.20.0000.00917.89
8.2.10.0000.00718.10
8.2.00.0040.00418.11
8.1.280.0120.00925.92
8.1.270.0090.00023.82
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00322.03
8.1.230.0120.00020.96
8.1.220.0030.00518.75
8.1.210.0050.00318.77
8.1.200.0080.00017.35
8.1.190.0030.00617.12
8.1.180.0000.01018.10
8.1.170.0050.00317.62
8.1.160.0040.00422.06
8.1.150.0040.00418.82
8.1.140.0000.00819.51
8.1.130.0000.00717.77
8.1.120.0040.00317.39
8.1.110.0060.00317.36
8.1.100.0030.00317.36
8.1.90.0000.00817.34
8.1.80.0000.00817.36
8.1.70.0050.00317.36
8.1.60.0060.00317.50
8.1.50.0000.00817.54
8.1.40.0030.00617.56
8.1.30.0080.00017.66
8.1.20.0020.00517.56
8.1.10.0000.00817.58
8.1.00.0000.00817.49
8.0.300.0000.00719.98
8.0.290.0030.00616.63
8.0.280.0030.00318.34
8.0.270.0000.00817.31
8.0.260.0040.00417.19
8.0.250.0040.00417.02
8.0.240.0000.00717.00
8.0.230.0000.00916.99
8.0.220.0000.00716.83
8.0.210.0030.00316.94
8.0.200.0000.00717.04
8.0.190.0040.00416.93
8.0.180.0000.00716.88
8.0.170.0050.00216.90
8.0.160.0030.00516.95
8.0.150.0000.00916.95
8.0.140.0080.00016.91
8.0.130.0000.00513.36
8.0.120.0090.00016.84
8.0.110.0040.00416.97
8.0.100.0070.00017.00
8.0.90.0040.00416.80
8.0.80.0060.01017.02
8.0.70.0000.00716.96
8.0.60.0000.00816.81
8.0.50.0050.00317.01
8.0.30.0130.00517.07
8.0.20.0070.01117.40
8.0.10.0040.00417.00
8.0.00.0110.00916.83
7.4.330.0000.00515.20
7.4.320.0030.00316.63
7.4.300.0060.00016.61
7.4.290.0030.00316.53
7.4.280.0050.00316.49
7.4.270.0030.00316.62
7.4.260.0000.00716.60
7.4.250.0040.00416.38
7.4.240.0010.00616.55
7.4.230.0000.00716.52
7.4.220.0140.00416.64
7.4.210.0000.01616.60
7.4.200.0040.00416.73
7.4.160.0030.01316.30
7.4.150.0130.00317.40
7.4.140.0100.01017.86
7.4.130.0110.00916.64
7.4.120.0100.00816.64
7.4.110.0180.00316.54
7.4.100.0130.01016.62
7.4.90.0120.00616.61
7.4.80.0140.00619.39
7.4.70.0100.00716.65
7.4.60.0100.00616.41
7.4.50.0000.00516.54
7.4.40.0090.00616.57
7.4.30.0120.00616.59
7.4.00.0100.00715.06
7.3.330.0020.00213.43
7.3.320.0030.00313.50
7.3.310.0080.00016.52
7.3.300.0030.00516.45
7.3.290.0100.00716.43
7.3.280.0070.00916.43
7.3.270.0120.00917.40
7.3.260.0090.00916.44
7.3.250.0110.00616.52
7.3.240.0060.01316.49
7.3.230.0070.01016.42
7.3.210.0100.00616.36
7.3.200.0120.00416.73
7.3.190.0040.01216.63
7.3.180.0140.00316.40
7.3.170.0140.00316.52
7.3.160.0080.00816.56
7.3.120.0100.01014.95
7.3.110.0000.01214.88
7.3.100.0000.01114.60
7.3.90.0070.00714.63
7.3.80.0080.00414.89
7.3.70.0000.01414.79
7.3.60.0040.00814.91
7.3.50.0070.01114.66
7.3.40.0090.00315.03
7.3.30.0080.00314.82
7.3.20.0000.01516.55
7.3.10.0080.00816.55
7.3.00.0030.00816.53
7.2.330.0090.00916.88
7.2.320.0070.01016.86
7.2.310.0140.00316.61
7.2.300.0100.01416.69
7.2.290.0090.00916.59
7.2.250.0130.00715.16
7.2.240.0060.01215.12
7.2.230.0000.01515.39
7.2.220.0030.01314.89
7.2.210.0000.01414.94
7.2.200.0080.00715.09
7.2.190.0070.00715.17
7.2.180.0070.01015.02
7.2.170.0040.00815.17
7.2.60.0040.01116.88
7.2.00.0060.00919.60
7.1.330.0030.00915.84
7.1.320.0030.01015.72
7.1.310.0070.00715.82
7.1.300.0070.00715.88
7.1.290.0070.00715.71
7.1.280.0030.00615.78
7.1.270.0040.01115.75
7.1.260.0080.00415.91
7.1.200.0080.00415.88
7.1.100.0030.01018.23
7.1.70.0070.00717.23
7.1.60.0130.01019.43
7.1.50.0090.00617.05
7.1.00.0030.07322.31
7.0.200.0240.00714.93
7.0.60.0030.07019.98
7.0.50.0030.04017.91
7.0.40.0100.06020.40
7.0.30.0400.08320.07
7.0.20.0170.05720.07
7.0.10.0100.08320.30
7.0.00.0030.05720.05
5.6.280.0030.05021.13
5.6.210.0170.05320.71
5.6.200.0070.06018.15
5.6.190.0030.09320.34
5.6.180.0270.07720.67
5.6.170.0200.05020.55
5.6.160.0030.04720.56
5.6.150.0030.04018.23
5.6.140.0070.08318.11
5.6.130.0070.06318.14
5.6.120.0070.08021.14
5.6.110.0170.07720.97
5.6.100.0230.07321.02
5.6.90.0100.08021.09
5.6.80.0130.04720.38
5.5.350.0270.08020.40
5.5.340.0170.08718.03
5.5.330.0000.05020.25
5.5.320.0270.06720.35
5.5.310.0230.04720.27
5.5.300.0000.06017.96
5.5.290.0000.06017.95
5.5.280.0100.04320.77
5.5.270.0100.08320.84
5.5.260.0130.07720.65
5.5.250.0030.04320.59
5.5.240.0070.05320.17
5.4.450.0430.06719.55
5.4.440.0170.06019.14
5.4.430.0170.05319.60
5.4.420.0270.07719.28
5.4.410.0400.06019.02
5.4.400.0370.04019.28
5.4.390.0300.05719.22
5.4.380.0300.04319.11
5.4.370.0270.05319.26
5.4.360.0100.06719.26
5.4.350.0200.06318.99
5.4.340.0230.04319.07
5.4.320.0200.04719.15
5.4.310.0130.05719.22
5.4.300.0200.05718.98
5.4.290.0130.07719.26
5.4.280.0430.07719.04
5.4.270.0530.05719.26
5.4.260.0200.04719.16
5.4.250.0200.04719.07
5.4.240.0300.05719.27
5.4.230.0500.05018.80
5.4.220.0170.05019.21
5.4.210.0100.06719.07
5.4.200.0300.06019.10
5.4.190.0530.05319.09
5.4.180.0600.04719.09
5.4.170.0500.06319.27
5.4.160.0400.05319.35
5.4.150.0500.05719.20
5.4.140.0570.06716.49
5.4.130.0270.05316.49
5.4.120.0170.04716.79
5.4.110.0100.05716.57
5.4.100.0200.04016.64
5.4.90.0230.04016.66
5.4.80.0170.05316.45
5.4.70.0130.04716.55
5.4.60.0100.05316.58
5.4.50.0200.04016.50
5.4.40.0070.06716.49
5.4.30.0200.04716.22
5.4.20.0170.05716.50
5.4.10.0200.04316.57
5.4.00.0370.04715.89

preferences:
57.36 ms | 401 KiB | 5 Q