3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { /** * A test function * * First parameter must be an object of type OtherClass */ public function test(OtherClass $otherclass) { echo $otherclass->var; } /** * Another test function * * First parameter must be an array */ public function test_array(array $input_array) { print_r($input_array); } /** * First parameter must be iterator */ public function test_interface(Traversable $iterator) { echo get_class($iterator); } /** * First parameter must be callable */ public function test_callable(callable $callback, $data) { call_user_func($callback, $data); } } // Another example class class OtherClass { public $var = 'Hello World'; } $myclass = new MyClass; $otherclass = new OtherClass; $foo = new OtherClass; $foo->test($myclass); $myclass->test($otherclass); // Works: Prints the array $myclass->test_array(array('a', 'b', 'c')); // Works: Prints ArrayObject $myclass->test_interface(new ArrayObject(array())); // Works: Prints int(1) $myclass->test_callable('var_dump', 1); ?>

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.01018.56
8.3.50.0110.00922.10
8.3.40.0060.00918.61
8.3.30.0120.00919.08
8.3.20.0040.00420.16
8.3.10.0000.00822.15
8.3.00.0040.00422.58
8.2.180.0000.01516.88
8.2.170.0030.01722.96
8.2.160.0070.00719.16
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0030.00519.36
8.2.110.0000.00922.24
8.2.100.0040.00817.78
8.2.90.0040.00419.23
8.2.80.0040.00418.04
8.2.70.0040.00417.50
8.2.60.0050.00317.80
8.2.50.0050.00318.07
8.2.40.0040.00418.16
8.2.30.0080.00019.80
8.2.20.0050.00317.62
8.2.10.0040.00417.73
8.2.00.0040.00419.47
8.1.280.0130.00725.92
8.1.270.0080.00021.99
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00720.67
8.1.230.0090.00317.77
8.1.220.0050.00317.74
8.1.210.0000.00918.77
8.1.200.0000.00917.35
8.1.190.0080.00017.40
8.1.180.0040.00418.81
8.1.170.0080.00018.56
8.1.160.0040.00421.97
8.1.150.0030.00518.59
8.1.140.0000.00817.32
8.1.130.0000.00717.77
8.1.120.0070.00017.43
8.1.110.0070.00017.32
8.1.100.0000.00717.41
8.1.90.0040.00417.30
8.1.80.0000.00717.34
8.1.70.0000.00717.33
8.1.60.0000.00817.53
8.1.50.0040.00417.55
8.1.40.0050.00217.47
8.1.30.0030.00617.58
8.1.20.0040.00417.67
8.1.10.0060.00317.56
8.1.00.0040.00417.50
8.0.300.0040.00418.77
8.0.290.0050.00217.05
8.0.280.0040.00418.27
8.0.270.0070.00017.22
8.0.260.0040.00416.75
8.0.250.0000.00716.96
8.0.240.0040.00416.98
8.0.230.0060.00316.97
8.0.220.0070.00016.98
8.0.210.0000.00716.93
8.0.200.0000.00617.02
8.0.190.0050.00316.90
8.0.180.0030.00316.98
8.0.170.0040.00416.87
8.0.160.0000.00816.93
8.0.150.0030.00316.71
8.0.140.0000.00716.79
8.0.130.0000.00513.39
8.0.120.0030.00516.85
8.0.110.0050.00316.87
8.0.100.0000.00716.92
8.0.90.0000.00816.86
8.0.80.0060.00916.89
8.0.70.0030.00616.91
8.0.60.0000.00816.96
8.0.50.0040.00416.89
8.0.30.0070.01317.07
8.0.20.0130.00617.40
8.0.10.0070.00016.84
8.0.00.0110.00816.85
7.4.330.0020.00215.09
7.4.320.0030.00316.51
7.4.300.0000.00716.57
7.4.290.0000.00816.45
7.4.280.0000.00816.49
7.4.270.0070.00016.64
7.4.260.0030.00716.57
7.4.250.0000.00716.55
7.4.240.0000.00716.59
7.4.230.0070.00016.55
7.4.220.0160.00616.64
7.4.210.0070.01016.63
7.4.200.0020.00516.51
7.4.190.0000.00716.70
7.4.160.0080.00816.39
7.4.150.0040.01417.40
7.4.140.0140.00717.86
7.4.130.0080.01016.59
7.4.120.0110.00616.37
7.4.110.0030.01316.37
7.4.100.0070.01016.70
7.4.90.0140.00416.46
7.4.80.0120.01219.39
7.4.70.0120.00616.45
7.4.60.0080.00916.66
7.4.50.0030.00516.60
7.4.40.0080.00522.77
7.4.30.0090.00916.79
7.4.00.0030.01014.93
7.3.330.0000.00613.18
7.3.320.0030.00313.31
7.3.310.0030.00316.20
7.3.300.0060.00016.28
7.3.290.0070.00716.28
7.3.280.0070.01016.30
7.3.270.0030.01717.40
7.3.260.0280.02216.53
7.3.250.0080.01016.55
7.3.240.0070.01116.28
7.3.230.0140.00316.39
7.3.210.0130.00616.59
7.3.200.0060.01219.39
7.3.190.0080.01116.62
7.3.180.0080.00816.52
7.3.170.0030.01516.30
7.3.160.0030.01516.21
7.3.120.0080.00814.59
7.3.10.0070.00716.56
7.3.00.0090.00316.41
7.2.330.0150.00416.71
7.2.320.0120.00816.77
7.2.310.0100.00616.48
7.2.300.0060.01016.42
7.2.290.0070.01016.45
7.2.130.0110.00416.71
7.2.120.0030.00616.35
7.2.110.0030.00616.38
7.2.100.0060.00616.56
7.2.90.0050.00516.32
7.2.80.0030.00816.15
7.2.70.0000.01216.48
7.2.60.0040.00916.55
7.2.50.0060.00616.76
7.2.40.0040.00716.35
7.2.30.0060.00616.38
7.2.20.0000.01516.55
7.2.10.0030.00916.17
7.2.00.0070.00517.91
7.1.250.0070.00415.33
7.1.200.0040.01215.59
7.1.100.0040.00817.73
7.1.70.0200.00716.82
7.1.60.0100.01319.82
7.1.50.0110.01116.85
7.1.00.0000.08022.44
7.0.200.0040.00416.66
7.0.140.0070.07021.92
7.0.60.0170.07719.94
7.0.50.0070.07017.84
7.0.40.0170.05020.30
7.0.30.0270.06720.16
7.0.20.0270.06720.06
7.0.10.0300.06020.09
7.0.00.0070.08320.07
5.6.280.0000.07721.10
5.6.210.0200.07320.70
5.6.200.0100.08318.22
5.6.190.0030.05720.63
5.6.180.3670.04320.62
5.6.170.0400.07320.43
5.6.160.0100.04020.61
5.6.150.0070.03718.15
5.6.140.0130.07718.11
5.6.130.0030.08318.26
5.6.120.0100.08321.05
5.6.110.0070.09321.03
5.6.100.0070.08021.02
5.6.90.0130.08020.96
5.6.80.0130.07720.36
5.6.70.0230.06020.43
5.5.350.0000.08020.34
5.5.340.0070.03717.98
5.5.330.0130.07720.21
5.5.320.0170.07720.33
5.5.310.0270.05720.26
5.5.300.0100.08017.94
5.5.290.0030.08717.94
5.5.280.0000.06320.89
5.5.270.0030.08020.98
5.5.260.0300.07320.88
5.5.250.0170.06320.62
5.5.240.0070.08320.16
5.4.450.0570.06019.70
5.4.440.0670.06019.47
5.4.430.0000.06319.52
5.4.420.0100.05719.21
5.4.410.0100.05319.41
5.4.400.0870.00018.52
5.4.390.0770.00018.59
5.4.380.0170.06018.75
5.4.370.0230.05018.75
5.4.360.0200.05318.75
5.4.350.0330.05318.82
5.4.340.0230.05018.79
5.4.320.0050.03912.51
5.4.310.0080.04612.50
5.4.300.0050.03612.50
5.4.290.0050.03912.50
5.4.280.0050.03912.40
5.4.270.0090.03712.40
5.4.260.0040.04012.39
5.4.250.0030.04212.40
5.4.240.0060.03912.40
5.4.230.0030.03912.39
5.4.220.0060.03512.39
5.4.210.0040.03812.39
5.4.200.0060.05112.39
5.4.190.0130.06018.73
5.4.180.0000.05718.94
5.4.170.0130.04318.72
5.4.160.0170.06718.73
5.4.150.0070.05718.87
5.4.140.0170.04716.50
5.4.130.0070.07716.36
5.4.120.0100.05016.44
5.4.110.0030.05016.43
5.4.100.0070.04716.60
5.4.90.0070.04716.36
5.4.80.0130.06716.59
5.4.70.0070.04716.51
5.4.60.0070.04716.59
5.4.50.0070.05016.41
5.4.40.0100.04716.69
5.4.30.0000.05316.41
5.4.20.0070.05016.48
5.4.10.0070.05016.48
5.4.00.0070.04715.96
5.3.290.0050.04112.80
5.3.280.0050.04412.71
5.3.270.0070.05014.70
5.3.260.0100.05014.79
5.3.250.0070.05014.75
5.3.240.0070.05014.44
5.3.230.0100.04714.69
5.3.220.0030.05714.75
5.3.210.0070.06014.56
5.3.200.0100.05314.54
5.3.190.0170.04014.65
5.3.180.0030.05714.57
5.3.170.0000.05714.40
5.3.160.0100.04314.40
5.3.150.0100.04714.40
5.3.140.0030.05314.73
5.3.130.0000.05714.63
5.3.120.0130.04314.77
5.3.110.0130.04714.48
5.3.100.0130.04713.97
5.3.90.0070.04714.11
5.3.80.0100.04714.00
5.3.70.0070.07013.85
5.3.60.0030.06314.09
5.3.50.0030.06014.12
5.3.40.0030.05313.97
5.3.30.0130.06314.09
5.3.20.0070.05013.69
5.3.10.0100.04713.67
5.3.00.0100.04713.55
5.2.170.0070.04711.23
5.2.160.0070.04311.24
5.2.150.0030.04711.14
5.2.140.0170.03011.23
5.2.130.0130.03011.20
5.2.120.0070.05711.11
5.2.110.0070.04011.32
5.2.100.0030.04711.09
5.2.90.0070.05311.10
5.2.80.0130.03711.07
5.2.70.0030.04011.06
5.2.60.0030.04311.28
5.2.50.0100.03710.86
5.2.40.0030.04011.09
5.2.30.0170.04711.07
5.2.20.0100.04311.05
5.2.10.0100.03710.84
5.2.00.0030.04010.80
5.1.60.0070.03710.21
5.1.50.0000.03710.20
5.1.40.0070.03310.07
5.1.30.0100.03310.41
5.1.20.0070.04010.32
5.1.10.0070.04710.13
5.1.00.0070.04710.00
5.0.50.0000.0308.74
5.0.40.0000.0308.25
5.0.30.0000.0438.29
5.0.20.0100.0278.39
5.0.10.0030.0338.16
5.0.00.0000.0438.32
4.4.90.0030.0205.76
4.4.80.0070.0175.84
4.4.70.0000.0235.84
4.4.60.0030.0275.81
4.4.50.0030.0205.92
4.4.40.0100.0275.83
4.4.30.0000.0235.85
4.4.20.0070.0175.89
4.4.10.0030.0335.89
4.4.00.0000.0375.84
4.3.110.0100.0135.70
4.3.100.0030.0205.76
4.3.90.0000.0305.80
4.3.80.0000.0435.77
4.3.70.0000.0235.87
4.3.60.0000.0205.87
4.3.50.0070.0275.73
4.3.40.0000.0335.72
4.3.30.0070.0235.45
4.3.20.0070.0205.45
4.3.10.0030.0235.45
4.3.00.0100.0339.22

preferences:
47.46 ms | 400 KiB | 5 Q