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 MyClass; $foo->test($otherclass); $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.0150.00316.63
8.3.50.0140.00817.42
8.3.40.0070.01018.93
8.3.30.0000.01418.77
8.3.20.0080.00018.64
8.3.10.0040.00420.48
8.3.00.0150.00017.75
8.2.180.0080.00616.75
8.2.170.0070.00722.96
8.2.160.0140.00722.26
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0060.00319.76
8.2.110.0060.00320.78
8.2.100.0080.00317.72
8.2.90.0030.00619.05
8.2.80.0040.00418.04
8.2.70.0030.00617.50
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0050.00318.22
8.2.30.0060.00318.07
8.2.20.0070.00017.77
8.2.10.0080.00017.51
8.2.00.0000.00917.56
8.1.280.0140.00725.92
8.1.270.0070.00024.66
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0060.00320.75
8.1.230.0080.00320.85
8.1.220.0030.00617.79
8.1.210.0040.00418.85
8.1.200.0060.00317.23
8.1.190.0000.00917.51
8.1.180.0040.00418.10
8.1.170.0040.00418.75
8.1.160.0040.00418.84
8.1.150.0030.00618.49
8.1.140.0030.00617.39
8.1.130.0000.00717.84
8.1.120.0000.00717.41
8.1.110.0040.00417.45
8.1.100.0040.00417.45
8.1.90.0040.00417.45
8.1.80.0040.00317.45
8.1.70.0000.00817.41
8.1.60.0070.00017.49
8.1.50.0040.00417.47
8.1.40.0040.00417.54
8.1.30.0040.00417.55
8.1.20.0000.00817.64
8.1.10.0050.00217.55
8.1.00.0000.00717.54
8.0.300.0040.00419.94
8.0.290.0040.00416.88
8.0.280.0070.00018.37
8.0.270.0030.00317.12
8.0.260.0070.00016.80
8.0.250.0040.00417.05
8.0.240.0000.00717.06
8.0.230.0050.00216.96
8.0.220.0020.00516.95
8.0.210.0000.00716.90
8.0.200.0020.00516.94
8.0.190.0000.00817.00
8.0.180.0060.00316.91
8.0.170.0000.00816.88
8.0.160.0000.00816.80
8.0.150.0000.00716.80
8.0.140.0050.00316.76
8.0.130.0000.00713.34
8.0.120.0030.00516.86
8.0.110.0000.00716.82
8.0.100.0050.00216.79
8.0.90.0000.00716.97
8.0.80.0130.00316.81
8.0.70.0040.00416.75
8.0.60.0030.00416.90
8.0.50.0070.00016.94
8.0.30.0130.00617.29
8.0.20.0070.01517.16
8.0.10.0000.00817.10
8.0.00.0090.00816.79
7.4.330.0050.00014.77
7.4.320.0060.00016.54
7.4.300.0060.00016.46
7.4.290.0060.00316.53
7.4.280.0000.00916.44
7.4.270.0030.00316.62
7.4.260.0000.00513.34
7.4.250.0060.00316.59
7.4.240.0050.00316.61
7.4.230.0040.00416.62
7.4.220.0130.00716.59
7.4.210.0050.01116.50
7.4.200.0040.00416.41
7.4.190.0070.00016.68
7.4.160.0060.01016.48
7.4.150.0100.00717.07
7.4.140.0080.00817.16
7.4.130.0120.00716.38
7.4.120.0140.01016.56
7.4.110.0100.00716.49
7.4.100.0110.01116.46
7.4.90.0040.01416.34
7.4.80.0030.01418.63
7.4.70.0090.00616.52
7.4.60.0130.00316.50
7.4.50.0000.00420.34
7.4.40.0040.00721.69
7.4.30.0130.00416.34
7.4.00.0030.01015.00
7.3.330.0060.00013.18
7.3.320.0060.00013.18
7.3.310.0060.00316.21
7.3.300.0060.00016.20
7.3.290.0110.00416.33
7.3.280.0130.00616.33
7.3.270.0080.00917.07
7.3.260.0120.00518.24
7.3.250.0130.00816.46
7.3.240.0110.00516.45
7.3.230.0060.01016.54
7.3.210.0130.00316.39
7.3.200.0070.01419.39
7.3.190.0170.00616.48
7.3.180.0070.01016.42
7.3.170.0030.01316.27
7.3.160.0040.01216.54
7.3.120.0030.01514.85
7.2.330.0090.00916.80
7.2.320.0100.01316.36
7.2.310.0070.01416.80
7.2.300.0110.00516.46
7.2.290.0070.01016.61
7.1.70.0030.00617.30
7.1.60.0130.01319.40
7.1.50.0080.01117.14
7.1.00.0100.07022.32
7.0.200.0040.00816.73
7.0.140.0000.07022.17
7.0.120.0000.03322.16
7.0.60.0030.07019.89
7.0.50.0100.08017.90
7.0.40.0100.06020.24
7.0.30.0230.03720.09
7.0.20.0330.08020.07
7.0.10.0100.06720.23
7.0.00.0070.08320.09
5.6.280.0100.07020.82
5.6.210.0130.07320.77
5.6.200.0070.03718.18
5.6.190.0100.06020.49
5.6.180.0330.08320.64
5.6.170.0230.04720.56
5.6.160.0030.07320.62
5.6.150.0070.04018.18
5.6.140.0070.05018.17
5.6.130.0070.03718.11
5.6.120.0030.07321.08
5.6.110.0070.08021.05
5.6.100.0100.07021.03
5.6.90.0100.04020.96
5.6.80.0070.08020.39
5.5.350.0270.06720.36
5.5.340.0130.07317.94
5.5.330.0100.05020.35
5.5.320.0100.07720.32
5.5.310.0100.05020.34
5.5.300.0030.04018.07
5.5.290.0000.04318.05
5.5.280.0030.04720.88
5.5.270.0100.09020.83
5.5.260.0030.08720.90
5.5.250.0000.04320.68
5.5.240.0000.07320.29
5.4.450.0030.04019.57
5.4.440.0100.05719.33
5.4.430.0130.08019.40
5.4.420.0130.03719.19
5.4.410.0030.04019.14
5.4.400.0030.07319.25
5.4.390.0000.05319.14
5.4.380.0100.07319.14
5.4.370.0100.06318.92
5.4.360.0100.05019.14
5.4.350.0000.06719.12
5.4.340.0100.07319.00
5.4.320.0070.08019.15
5.4.310.0100.07019.14
5.4.300.0030.04018.98
5.4.290.0130.03018.97
5.4.280.0100.07718.87
5.4.270.0070.04319.16
5.4.260.0100.05319.24
5.4.250.0100.04318.84
5.4.240.0000.04719.23
5.4.230.0000.04019.23
5.4.220.0030.03719.24
5.4.210.0000.04319.23
5.4.200.0070.03319.14
5.4.190.0070.03318.97
5.4.180.0070.03318.91
5.4.170.0070.04019.13
5.4.160.0070.03319.21
5.4.150.0030.03719.09
5.4.140.0030.03316.40
5.4.130.0000.03716.32
5.4.120.0030.03316.45
5.4.110.0070.03716.48
5.4.100.0070.03016.42
5.4.90.0030.03316.39
5.4.80.0000.03716.33
5.4.70.0030.03316.50
5.4.60.0070.03716.64
5.4.50.0000.03716.31
5.4.40.0000.03716.44
5.4.30.0030.03716.27
5.4.20.0030.04016.38
5.4.10.0030.03716.64
5.4.00.0030.03715.94
5.3.290.0070.05014.68
5.3.280.0000.04014.68
5.3.270.0070.03314.69
5.3.260.0130.02714.69
5.3.250.0000.03714.52
5.3.240.0030.03314.62
5.3.230.0000.04014.61
5.3.220.0000.03714.63
5.3.210.0030.03714.46
5.3.200.0070.04014.65
5.3.190.0030.03714.58
5.3.180.0030.03714.60
5.3.170.0000.04014.64
5.3.160.0030.03314.61
5.3.150.0030.04014.51
5.3.140.0070.03714.61
5.3.130.0070.03714.57
5.3.120.0030.03714.70
5.3.110.0130.02714.45
5.3.100.0070.03314.19
5.3.90.0000.03714.02
5.3.80.0000.03714.02
5.3.70.0000.03714.07
5.3.60.0030.03314.07
5.3.50.0000.03714.00
5.3.40.0000.03713.95
5.3.30.0000.03713.91
5.3.20.0030.07013.88
5.3.10.0070.06713.61
5.3.00.0070.04313.56
5.2.170.0030.02711.13
5.2.160.0000.03311.11
5.2.150.0030.04711.32
5.2.140.0070.02711.10
5.2.130.0030.04011.07
5.2.120.0000.05011.09
5.2.110.0000.06311.13
5.2.100.0000.03711.00
5.2.90.0100.03011.01
5.2.80.0030.03011.16
5.2.70.0070.03711.15
5.2.60.0070.06011.11
5.2.50.0030.05011.09
5.2.40.0130.05311.00
5.2.30.0000.05011.05
5.2.20.0100.05310.98
5.2.10.0030.04010.79
5.2.00.0000.03710.72
5.1.60.0030.0539.98
5.1.50.0030.05710.07
5.1.40.0000.0609.95
5.1.30.0070.05010.42
5.1.20.0100.05710.36
5.1.10.0000.04710.22
5.1.00.0030.05310.05
5.0.50.0100.0178.59
5.0.40.0100.0278.48
5.0.30.0070.0638.24
5.0.20.0030.0408.16
5.0.10.0000.0478.14
5.0.00.0000.0678.31
4.4.90.0000.0207.73
4.4.80.0070.0177.73
4.4.70.0000.0377.73
4.4.60.0000.0237.73
4.4.50.0030.0207.73
4.4.40.0000.0477.73
4.4.30.0030.0337.73
4.4.20.0070.0307.73
4.4.10.0000.0237.73
4.4.00.0070.0537.73
4.3.110.0000.0407.73
4.3.100.0030.0307.73
4.3.90.0030.0337.73
4.3.80.0000.0607.73
4.3.70.0000.0377.73
4.3.60.0030.0207.73
4.3.50.0000.0337.73
4.3.40.0030.0507.73
4.3.30.0000.0237.73
4.3.20.0030.0177.73
4.3.10.0000.0377.73
4.3.00.0030.0337.73

preferences:
46.28 ms | 401 KiB | 5 Q