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($foo); $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.0170.00318.31
8.3.50.0090.01021.89
8.3.40.0060.00918.67
8.3.30.0090.00619.16
8.3.20.0150.00320.31
8.3.10.0040.00423.65
8.3.00.0040.00422.40
8.2.180.0070.01418.79
8.2.170.0100.00722.96
8.2.160.0030.01222.27
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0100.00019.32
8.2.110.0070.01022.25
8.2.100.0000.01217.84
8.2.90.0000.00919.25
8.2.80.0040.00417.97
8.2.70.0060.00617.25
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0040.00418.09
8.2.30.0050.00218.06
8.2.20.0030.00517.66
8.2.10.0000.00817.76
8.2.00.0040.00417.73
8.1.280.0060.01225.92
8.1.270.0040.00422.01
8.1.260.0040.00426.35
8.1.250.0150.00428.09
8.1.240.0040.00423.82
8.1.230.0070.00319.15
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0030.00517.30
8.1.180.0040.00418.10
8.1.170.0080.00018.66
8.1.160.0000.00821.97
8.1.150.0040.00418.54
8.1.140.0000.00717.44
8.1.130.0000.00717.73
8.1.120.0000.00917.45
8.1.110.0000.00717.25
8.1.100.0040.00417.41
8.1.90.0050.00317.43
8.1.80.0040.00417.32
8.1.70.0000.00717.34
8.1.60.0060.00317.50
8.1.50.0060.00317.59
8.1.40.0050.00217.48
8.1.30.0040.00417.52
8.1.20.0040.00417.56
8.1.10.0020.00517.55
8.1.00.0000.00817.54
8.0.300.0000.00718.77
8.0.290.0000.00816.92
8.0.280.0030.00318.31
8.0.270.0040.00417.15
8.0.260.0000.00718.39
8.0.250.0000.00716.94
8.0.240.0070.00416.96
8.0.230.0000.00716.95
8.0.220.0070.00016.87
8.0.210.0000.00716.95
8.0.200.0000.00616.97
8.0.190.0030.00516.89
8.0.180.0050.00216.90
8.0.170.0050.00316.88
8.0.160.0040.00416.89
8.0.150.0000.00716.75
8.0.140.0000.00816.90
8.0.130.0030.00513.34
8.0.120.0080.00016.77
8.0.110.0080.00016.88
8.0.100.0030.00516.82
8.0.90.0070.00016.85
8.0.80.0100.00616.86
8.0.70.0080.00016.92
8.0.60.0000.00816.82
8.0.50.0040.00416.70
8.0.30.0110.00917.01
8.0.20.0100.00817.40
8.0.10.0040.00417.02
8.0.00.0150.00616.85
7.4.330.0000.00515.03
7.4.320.0000.00616.51
7.4.300.0000.00616.59
7.4.290.0070.00016.44
7.4.280.0030.00316.52
7.4.270.0060.00316.61
7.4.260.0000.00716.60
7.4.250.0030.00516.61
7.4.240.0030.00516.64
7.4.230.0030.00516.55
7.4.220.0030.01416.69
7.4.210.0030.01116.57
7.4.200.0030.00316.51
7.4.190.0040.00416.71
7.4.160.0120.00316.58
7.4.150.0150.00317.40
7.4.140.0100.01017.86
7.4.130.0050.01616.50
7.4.120.0060.01216.44
7.4.110.0060.01616.43
7.4.100.0140.00716.39
7.4.90.0090.01216.61
7.4.80.0130.00316.50
7.4.70.0150.00916.37
7.4.60.0130.00416.37
7.4.50.0060.00316.61
7.4.40.0070.01022.77
7.4.30.0070.01016.48
7.4.00.0080.00814.93
7.3.330.0030.00313.39
7.3.320.0020.00213.38
7.3.310.0030.00516.34
7.3.300.0000.00716.30
7.3.290.0070.01316.41
7.3.280.0080.01016.40
7.3.270.0120.00617.40
7.3.260.0040.01416.54
7.3.250.0120.00516.39
7.3.240.0060.01216.39
7.3.230.0060.00916.39
7.3.210.0140.00316.44
7.3.200.0130.00319.39
7.3.190.0060.01216.48
7.3.180.0100.01016.54
7.3.170.0090.01316.33
7.3.160.0090.00616.38
7.3.120.0040.01114.45
7.3.110.0040.00814.58
7.3.100.0060.00814.86
7.3.90.0100.00314.70
7.3.80.0090.00614.77
7.3.70.0000.01514.56
7.3.60.0070.00714.79
7.3.50.0100.00314.82
7.3.40.0060.00914.69
7.3.30.0100.00414.69
7.3.20.0100.00716.68
7.3.10.0060.00516.66
7.3.00.0090.00616.59
7.2.330.0070.01116.75
7.2.320.0030.02016.36
7.2.310.0130.00316.35
7.2.300.0040.01216.73
7.2.290.0000.01616.53
7.2.240.0060.00914.79
7.2.230.0100.00715.13
7.2.220.0130.00315.11
7.2.210.0000.01414.99
7.2.200.0080.00814.99
7.2.190.0040.01114.97
7.2.180.0120.00314.91
7.2.170.0060.00914.82
7.2.160.0070.00714.64
7.2.150.0040.01116.95
7.2.140.0090.00616.67
7.2.130.0050.00916.88
7.2.120.0080.00716.75
7.2.110.0030.01016.68
7.2.100.0090.00616.65
7.2.90.0070.00816.68
7.2.80.0070.00716.80
7.2.70.0080.00616.90
7.2.60.0100.00516.90
7.2.50.0060.00716.87
7.2.40.0060.00616.80
7.2.30.0080.00716.75
7.2.20.0060.00916.76
7.2.10.0070.00616.76
7.2.00.0090.00616.84
7.1.330.0040.01215.66
7.1.320.0070.00715.81
7.1.310.0030.01115.64
7.1.300.0030.00715.48
7.1.290.0040.00715.52
7.1.280.0000.01515.65
7.1.270.0060.00615.64
7.1.260.0040.01115.45
7.1.250.0040.00915.60
7.1.200.0030.00915.68
7.1.70.0140.00416.99
7.1.60.0080.01119.32
7.1.50.0070.01716.84
7.1.00.0000.07722.45
7.0.200.0070.00716.84
7.0.140.0030.07322.09
7.0.60.0100.08320.05
7.0.50.0130.07017.90
7.0.40.0170.07320.24
7.0.30.0270.07720.12
7.0.20.0200.06020.30
7.0.10.0330.07320.33
7.0.00.0030.08020.33
5.6.280.0100.06721.13
5.6.210.0100.08320.77
5.6.200.0030.09318.29
5.6.190.0070.07020.34
5.6.180.0030.04020.47
5.6.170.0200.05020.44
5.6.160.0100.08320.46
5.6.150.0070.07318.17
5.6.140.0070.03718.15
5.6.130.0070.03718.28
5.6.120.0030.04021.00
5.6.110.0000.04320.98
5.6.100.0030.08721.05
5.6.90.0030.05721.12
5.6.80.0130.07320.37
5.6.70.4000.03320.53
5.5.350.0100.07320.42
5.5.340.0070.06017.98
5.5.330.0170.07320.27
5.5.320.0030.07720.24
5.5.310.0200.05720.37
5.5.300.0130.06318.08
5.5.290.0130.07717.96
5.5.280.0030.07720.74
5.5.270.0100.03720.80
5.5.260.0200.07320.68
5.5.250.0070.04320.50
5.5.240.0070.05020.28
5.4.450.0900.04019.41
5.4.440.0470.03719.39
5.4.430.0870.03319.21
5.4.420.1000.03319.54
5.4.410.0500.03719.07
5.4.400.0400.05018.74
5.4.390.0400.05718.84
5.4.380.0100.05718.74
5.4.370.0130.05018.64
5.4.360.0230.05018.79
5.4.350.0270.04018.78
5.4.340.0030.06018.73
5.4.320.0090.03412.50
5.4.310.0100.03512.50
5.4.300.0080.03512.50
5.4.290.0100.03412.50
5.4.280.0050.04512.40
5.4.270.0140.04412.40
5.4.260.0060.04212.40
5.4.250.0050.03912.40
5.4.240.0050.03712.40
5.4.230.0080.03912.39
5.4.220.0070.03712.39
5.4.210.0060.03512.39
5.4.200.0070.04012.39
5.4.190.0180.04612.38
5.4.180.0170.04112.38
5.4.170.0110.04812.39
5.4.160.0200.04012.39
5.4.150.0160.04712.38
5.4.140.0170.04412.07
5.4.130.0130.04812.05
5.4.120.0220.03812.01
5.4.110.0230.04112.00
5.4.100.0140.05612.01
5.4.90.0180.04312.01
5.4.80.0220.04012.01
5.4.70.0170.04112.00
5.4.60.0150.04512.00
5.4.50.0120.04712.00
5.4.40.0170.04012.00
5.4.30.0160.04611.99
5.4.20.0140.04411.99
5.4.10.0120.04611.99
5.4.00.0160.04011.48
5.3.290.0090.03812.80
5.3.280.0060.04112.71
5.3.270.0190.04512.73
5.3.260.0180.04412.72
5.3.250.0200.04112.72
5.3.240.0160.04512.72
5.3.230.0140.04912.71
5.3.220.0170.04512.68
5.3.210.0110.05312.68
5.3.200.0130.05112.68
5.3.190.0180.04812.68
5.3.180.0200.05012.67
5.3.170.0200.04612.67
5.3.160.0200.04712.67
5.3.150.0200.04312.67
5.3.140.0190.05112.66
5.3.130.0310.06612.66
5.3.120.0180.04412.66
5.3.110.0200.04312.66
5.3.100.0140.04812.13
5.3.90.0130.04712.11
5.3.80.0150.04612.10
5.3.70.0120.05112.10
5.3.60.0130.04712.08
5.3.50.0160.04712.04
5.3.40.0210.04012.04
5.3.30.0130.04812.00
5.3.20.0170.04311.77
5.3.10.0190.03811.74
5.3.00.0180.04211.72
5.2.170.0090.0389.23
5.2.160.0130.0359.23
5.2.150.0140.0369.23
5.2.140.0110.0379.23
5.2.130.0130.0379.19
5.2.120.0170.0349.18
5.2.110.0100.0399.19
5.2.100.0150.0319.19
5.2.90.0120.0369.19
5.2.80.0130.0349.18
5.2.70.0190.0309.18
5.2.60.0140.0359.14
5.2.50.0120.0359.11
5.2.40.0110.0379.08
5.2.30.0180.0289.05
5.2.20.0160.0329.05
5.2.10.0120.0358.95
5.2.00.0100.0368.80
5.1.60.0140.0258.09
5.1.50.0170.0258.09
5.1.40.0140.0268.08
5.1.30.0090.0338.42
5.1.20.0090.0338.45
5.1.10.0130.0318.16
5.1.00.0120.0318.17
5.0.50.0120.0216.65
5.0.40.0100.0226.50
5.0.30.0080.0366.32
5.0.20.0090.0256.29
5.0.10.0100.0216.26
5.0.00.0060.0386.25
4.4.90.0080.0184.78
4.4.80.0100.0154.76
4.4.70.0100.0164.76
4.4.60.0070.0194.75
4.4.50.0070.0184.77
4.4.40.0060.0304.71
4.4.30.0060.0214.76
4.4.20.0070.0194.84
4.4.10.0090.0184.85
4.4.00.0060.0314.76
4.3.110.0060.0204.67
4.3.100.0100.0174.66
4.3.90.0120.0164.63
4.3.80.0060.0344.58
4.3.70.0080.0174.63
4.3.60.0110.0164.63
4.3.50.0090.0174.63
4.3.40.0080.0284.54
4.3.30.0040.0203.30
4.3.20.0080.0183.29
4.3.10.0030.0203.24
4.3.00.0030.01312.88

preferences:
41.82 ms | 401 KiB | 5 Q