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; $myclass->test($foo); // 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.0140.00016.63
8.3.50.0040.01217.49
8.3.40.0150.00018.84
8.3.30.0110.00418.85
8.3.20.0080.00018.75
8.3.10.0040.00420.57
8.3.00.0040.00419.38
8.2.180.0150.00018.54
8.2.170.0070.01022.96
8.2.160.0070.00721.09
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0090.00020.99
8.2.110.0060.00321.03
8.2.100.0080.00317.91
8.2.90.0080.00019.47
8.2.80.0030.00619.21
8.2.70.0060.00317.63
8.2.60.0030.00517.68
8.2.50.0040.00418.07
8.2.40.0000.00718.34
8.2.30.0040.00417.92
8.2.20.0040.00419.43
8.2.10.0040.00417.48
8.2.00.0050.00317.68
8.1.280.0070.00725.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00422.48
8.1.230.0000.01320.74
8.1.220.0040.00417.74
8.1.210.0060.00318.82
8.1.200.0030.00617.35
8.1.190.0000.00817.53
8.1.180.0060.00318.10
8.1.170.0040.00418.81
8.1.160.0000.00818.82
8.1.150.0000.00718.53
8.1.140.0040.00417.38
8.1.130.0000.00717.69
8.1.120.0050.00317.41
8.1.110.0070.00017.38
8.1.100.0030.00517.29
8.1.90.0040.00417.38
8.1.80.0040.00417.44
8.1.70.0030.00317.30
8.1.60.0080.00017.57
8.1.50.0000.00817.52
8.1.40.0040.00417.41
8.1.30.0040.00417.56
8.1.20.0040.00417.58
8.1.10.0060.00317.57
8.1.00.0040.00417.39
8.0.300.0040.00419.88
8.0.290.0030.00516.88
8.0.280.0070.00018.36
8.0.270.0000.00717.21
8.0.260.0060.00016.79
8.0.250.0040.00416.97
8.0.240.0080.00016.91
8.0.230.0030.00316.88
8.0.220.0000.00716.91
8.0.210.0040.00416.89
8.0.200.0000.00716.90
8.0.190.0000.00816.82
8.0.180.0050.00316.87
8.0.170.0050.00316.78
8.0.160.0000.00816.95
8.0.150.0000.00816.75
8.0.140.0040.00416.82
8.0.130.0060.00013.31
8.0.120.0080.00016.77
8.0.110.0040.00416.88
8.0.100.0070.00016.91
8.0.90.0070.00016.76
8.0.80.0070.00716.95
8.0.70.0000.00716.71
8.0.60.0040.00416.78
8.0.50.0030.00516.95
8.0.30.0120.00817.22
8.0.20.0110.00816.96
8.0.10.0070.00016.82
8.0.00.0090.00916.68
7.4.330.0000.00512.98
7.4.320.0000.00616.44
7.4.300.0030.00316.61
7.4.290.0030.00316.61
7.4.280.0030.00816.51
7.4.270.0040.00416.50
7.4.260.0050.00013.16
7.4.250.0030.00516.44
7.4.240.0050.00216.50
7.4.230.0030.00316.40
7.4.220.0070.01016.50
7.4.210.0060.00816.56
7.4.200.0020.00516.67
7.4.190.0030.00316.39
7.4.160.0130.00316.42
7.4.150.0120.00616.46
7.4.140.0100.01016.46
7.4.130.0100.01416.56
7.4.120.0060.01216.49
7.4.110.0060.01116.48
7.4.100.0110.00716.48
7.4.90.0070.01016.53
7.4.80.0120.00616.57
7.4.70.0110.00716.48
7.4.60.0060.00916.46
7.4.50.0090.00416.30
7.4.40.0100.00616.45
7.4.30.0070.01016.43
7.4.00.0060.01114.94
7.3.330.0030.00313.37
7.3.320.0000.00613.08
7.3.310.0000.00716.40
7.3.300.0000.00716.27
7.3.290.0070.01416.23
7.3.280.0090.00616.29
7.3.270.0160.00916.36
7.3.260.0110.00616.43
7.3.250.0120.01116.34
7.3.240.0110.00716.26
7.3.230.0130.00316.51
7.3.210.0100.01116.55
7.3.200.0090.01219.39
7.3.190.0090.00616.16
7.3.180.0080.00816.53
7.3.170.0090.00916.27
7.3.160.0120.00616.48
7.3.120.0080.00914.83
7.3.110.0070.01114.91
7.3.100.0120.00514.81
7.3.90.0020.01214.95
7.3.80.0060.00715.04
7.3.70.0050.00914.89
7.3.60.0000.01014.82
7.3.50.0060.00714.68
7.3.40.0050.01114.79
7.3.30.0070.00714.73
7.3.20.0050.01216.64
7.3.10.0080.00716.45
7.3.00.0080.00916.63
7.2.330.0120.00816.65
7.2.320.0100.01016.64
7.2.310.0100.01516.68
7.2.300.0090.00916.89
7.2.290.0070.01016.55
7.2.250.0050.01315.07
7.2.240.0080.01215.07
7.2.230.0060.00915.26
7.2.220.0080.00915.07
7.2.210.0070.00715.19
7.2.200.0080.00614.96
7.2.190.0030.00714.99
7.2.180.0100.00314.86
7.2.170.0050.01015.12
7.2.130.0000.01616.40
7.2.120.0070.01016.54
7.2.110.0110.01016.66
7.2.100.0050.01116.49
7.2.90.0100.00916.71
7.2.80.0050.01316.58
7.2.70.0150.00616.67
7.2.60.0080.00916.80
7.2.50.0110.00716.71
7.2.40.0070.00916.68
7.2.30.0070.01016.52
7.2.20.0050.01516.71
7.2.10.0120.00816.56
7.2.00.0090.01017.55
7.1.330.0030.01015.72
7.1.320.0020.01315.83
7.1.310.0080.00515.81
7.1.300.0050.00815.73
7.1.290.0100.00515.65
7.1.280.0030.00615.72
7.1.270.0060.00615.90
7.1.260.0060.00615.92
7.1.250.0140.00515.65
7.1.240.0060.00915.85
7.1.230.0070.00315.52
7.1.220.0100.00315.82
7.1.210.0000.01115.73
7.1.200.0060.00715.59
7.1.190.0100.00315.71
7.1.180.0060.00616.00
7.1.170.0070.00715.68
7.1.160.0080.00315.86
7.1.150.0030.00615.93
7.1.140.0120.00315.89
7.1.130.0000.00915.77
7.1.120.0080.00015.90
7.1.110.0060.00915.82
7.1.100.0010.01317.00
7.1.90.0070.00715.82
7.1.80.0070.00315.84
7.1.70.0030.00616.35
7.1.60.0060.01117.67
7.1.50.0050.01216.40
7.1.40.0060.00615.94
7.1.30.0030.01015.85
7.1.20.0030.01015.67
7.1.10.0060.00615.82
7.1.00.0020.02318.98
7.0.320.0000.01015.45
7.0.310.0000.01315.47
7.0.300.0030.01215.51
7.0.290.0090.00615.42
7.0.280.0000.01315.24
7.0.270.0060.00915.33
7.0.260.0120.00015.41
7.0.250.0040.01115.17
7.0.240.0120.00415.45
7.0.230.0000.01415.51
7.0.220.0100.00315.43
7.0.210.0140.00015.44
7.0.200.0020.00816.20
7.0.190.0070.00315.50
7.0.180.0090.00615.28
7.0.170.0050.00515.39
7.0.160.0070.00315.48
7.0.150.0060.00615.46
7.0.140.0060.03818.73
7.0.130.0030.00915.46
7.0.120.0080.03518.61
7.0.110.0070.00715.53
7.0.100.0090.00015.44
7.0.90.0060.00615.48
7.0.80.0040.00815.57
7.0.70.0040.00815.59
7.0.60.0100.01717.70
7.0.50.0120.03516.81
7.0.40.0050.03216.78
7.0.30.0220.04016.84
7.0.20.0190.04216.75
7.0.10.0110.04116.76
7.0.00.0040.04016.86
5.6.380.0070.00714.27
5.6.370.0090.00014.27
5.6.360.0070.00714.57
5.6.350.0070.00714.39
5.6.340.0000.01314.29
5.6.330.0060.00914.23
5.6.320.0030.01013.96
5.6.310.0070.00714.38
5.6.300.0030.00714.57
5.6.290.0030.01014.51
5.6.280.0070.03717.74
5.6.270.0090.00314.23
5.6.260.0060.01014.30
5.6.250.0090.00614.25
5.6.240.0110.00014.53
5.6.230.0000.01014.25
5.6.220.0030.00914.54
5.6.210.0090.04117.38
5.6.200.0100.03516.16
5.6.190.0070.02417.44
5.6.180.0190.03817.38
5.6.170.0200.04017.26
5.6.160.0150.02817.38
5.6.150.0050.02516.22
5.6.140.0030.03716.40
5.6.130.0070.04016.25
5.6.120.0120.04017.71
5.6.110.0080.04117.81
5.6.100.0080.04517.63
5.6.90.0080.03317.63
5.6.80.0050.02917.44
5.6.70.0070.00714.14
5.6.60.0000.00814.29
5.6.50.0030.00914.43
5.6.40.0080.00614.07
5.6.30.0130.00014.43
5.6.20.0080.00414.25
5.6.10.0060.00614.07
5.6.00.0060.01014.20
5.5.380.0070.00711.03
5.5.370.0090.00310.88
5.5.360.0070.00311.17
5.5.350.0120.04315.64
5.5.340.0050.02314.50
5.5.330.0140.03815.60
5.5.320.0150.04615.80
5.5.310.0270.03715.68
5.5.300.0050.02314.67
5.5.290.0070.03514.67
5.5.280.0060.02216.05
5.5.270.0020.02316.05
5.5.260.0030.03015.98
5.5.250.0070.04515.94
5.5.240.0040.04015.73
5.5.230.0030.00710.96
5.5.220.0030.00611.12
5.5.210.0030.00711.09
5.5.200.0030.00311.07
5.5.190.0070.00011.13
5.5.180.0030.00611.09
5.5.170.0030.01014.23
5.5.160.0030.00611.06
5.5.150.0050.00211.23
5.5.140.0030.00711.04
5.5.130.0000.00611.03
5.5.120.0000.00711.04
5.5.110.0040.00411.26
5.5.100.0040.00711.10
5.5.90.0040.00410.91
5.5.80.0100.00010.98
5.5.70.0000.00611.30
5.5.60.0090.00311.25
5.5.50.0000.01211.26
5.5.40.0030.00311.31
5.5.30.0000.00910.97
5.5.20.0040.00711.15
5.5.10.0100.00010.91
5.5.00.0060.00611.19
5.4.450.0330.01515.18
5.4.440.0280.02515.13
5.4.430.0390.01815.21
5.4.420.0270.02415.23
5.4.410.0330.02615.15
5.4.400.0340.01614.89
5.4.390.0240.02514.93
5.4.380.0370.01815.03
5.4.370.0330.03215.13
5.4.360.0340.02114.80
5.4.350.0210.02614.99
5.4.340.0320.02215.06
5.4.330.0030.00610.78
5.4.320.0190.01915.08
5.4.310.0460.02314.89
5.4.300.0600.02514.98
5.4.290.0170.02714.86
5.4.280.0180.01714.92
5.4.270.0430.02015.08
5.4.260.0450.02515.09
5.4.250.0370.01915.02
5.4.240.0300.02315.12
5.4.230.0460.02114.82
5.4.220.0350.02315.04
5.4.210.0230.02514.93
5.4.200.0230.01315.05
5.4.190.0430.02615.02
5.4.180.0200.01815.00
5.4.170.0280.02315.07
5.4.160.0200.02514.95
5.4.150.0410.02115.13
5.4.140.0170.02213.80
5.4.130.0310.02113.74
5.4.120.0200.04913.74
5.4.110.0200.02313.62
5.4.100.0350.02213.93
5.4.90.0300.01813.65
5.4.80.0400.02513.75
5.4.70.0340.01713.80
5.4.60.0120.02713.59
5.4.50.0230.02513.81
5.4.40.0450.02313.74
5.4.30.0300.02613.69
5.4.20.0250.02013.76
5.4.10.0220.02713.83
5.4.00.0300.02313.45
5.3.290.0270.01912.96
5.3.280.0370.02012.71
5.3.270.0200.02812.77
5.3.260.0380.01812.86
5.3.250.0330.01712.70
5.3.240.0280.02012.79
5.3.230.0410.02312.83
5.3.220.0310.01612.72
5.3.210.0400.02112.69
5.3.200.0320.04212.72
5.3.190.0170.02212.83
5.3.180.0210.02512.89
5.3.170.0180.02412.90
5.3.160.0190.01912.85
5.3.150.0240.04012.94
5.3.140.0320.02712.82
5.3.130.0270.02212.75
5.3.120.0230.02212.81
5.3.110.0320.01912.69
5.3.100.0230.02312.82
5.3.90.0350.01712.77
5.3.80.0270.02212.88
5.3.70.0300.01512.81
5.3.60.0310.02012.72
5.3.50.0200.02012.84
5.3.40.0250.02312.82
5.3.30.0240.02012.69
5.3.20.0250.01912.80
5.3.10.0180.02612.78
5.3.00.0190.02312.72
5.2.170.0170.01712.69
5.2.160.0100.01712.69
5.2.150.0120.02212.69
5.2.140.0240.02112.69
5.2.130.0380.02012.69
5.2.120.0150.01812.69
5.2.110.0080.01512.69
5.2.100.0320.01712.69
5.2.90.0120.01812.69
5.2.80.0300.01412.69
5.2.70.0320.01612.69
5.2.60.0290.02212.69
5.2.50.0130.01812.70
5.2.40.0100.01712.70
5.2.30.0020.01612.70
5.2.20.0300.01312.70
5.2.10.0180.01612.70
5.2.00.0210.01912.70
5.1.60.0240.01312.70
5.1.50.0190.01212.70
5.1.40.0180.01512.70
5.1.30.0230.01712.70
5.1.20.0180.01312.70
5.1.10.0290.01212.70
5.1.00.0160.01512.70
5.0.50.0090.01012.70
5.0.40.0070.01412.70
5.0.30.0130.01012.70
5.0.20.0050.01212.70
5.0.10.0050.01112.70
5.0.00.0110.01612.70
4.4.90.0080.00812.69
4.4.80.0130.01112.70
4.4.70.0000.01212.70
4.4.60.0050.01012.70
4.4.50.0070.01012.70
4.4.40.0080.01312.70
4.4.30.0100.00812.70
4.4.20.0170.00912.70
4.4.10.0110.01112.70
4.4.00.0080.01412.70
4.3.110.0170.01512.70
4.3.100.0120.00912.70
4.3.90.0150.01112.70
4.3.80.0070.01612.70
4.3.70.0070.00912.70
4.3.60.0100.00812.70
4.3.50.0120.00712.70
4.3.40.0070.01312.70
4.3.30.0020.01112.70
4.3.20.0050.01012.70
4.3.10.0030.01112.70
4.3.00.0070.01312.70

preferences:
43.46 ms | 401 KiB | 5 Q