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 $a) { echo $a->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.0070.00716.75
8.3.50.0080.00816.60
8.3.40.0070.00718.68
8.3.30.0100.00518.71
8.3.20.0060.00318.80
8.3.10.0060.00318.68
8.3.00.0080.00019.50
8.2.180.0150.00616.50
8.2.170.0100.01022.96
8.2.160.0120.00620.58
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0030.00520.97
8.2.110.0000.01120.47
8.2.100.0100.00017.72
8.2.90.0040.00419.18
8.2.80.0000.00719.32
8.2.70.0000.00817.63
8.2.60.0060.00318.03
8.2.50.0090.00019.35
8.2.40.0040.00418.34
8.2.30.0000.00818.10
8.2.20.0000.00817.48
8.2.10.0040.00417.68
8.2.00.0030.00517.60
8.1.280.0120.00625.92
8.1.270.0050.00323.99
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0070.00322.03
8.1.230.0040.00722.10
8.1.220.0000.00818.77
8.1.210.0090.00019.02
8.1.200.0090.00017.23
8.1.190.0050.00317.53
8.1.180.0050.00318.10
8.1.170.0000.00718.84
8.1.160.0040.00418.74
8.1.150.0040.00418.42
8.1.140.0040.00417.35
8.1.130.0000.00717.93
8.1.120.0030.00317.30
8.1.110.0000.00717.45
8.1.100.0000.00817.35
8.1.90.0040.00417.43
8.1.80.0000.00717.41
8.1.70.0070.00017.38
8.1.60.0080.00017.59
8.1.50.0000.00817.46
8.1.40.0050.00317.40
8.1.30.0030.00517.62
8.1.20.0030.00517.48
8.1.10.0040.00417.46
8.1.00.0000.00717.39
8.0.300.0090.00020.04
8.0.290.0050.00216.75
8.0.280.0000.00718.35
8.0.270.0030.00317.26
8.0.260.0000.00716.87
8.0.250.0000.00816.95
8.0.240.0070.00017.07
8.0.230.0000.00716.86
8.0.220.0030.00316.90
8.0.210.0000.00716.95
8.0.200.0030.00316.83
8.0.190.0050.00216.93
8.0.180.0070.00016.84
8.0.170.0000.00916.76
8.0.160.0000.00816.92
8.0.150.0080.00016.71
8.0.140.0090.00616.88
8.0.130.0060.00013.28
8.0.120.0040.00416.77
8.0.110.0080.00016.92
8.0.100.0040.00416.78
8.0.90.0040.00416.88
8.0.80.0100.00716.85
8.0.70.0000.00716.80
8.0.60.0000.00816.92
8.0.50.0000.00716.92
8.0.30.0060.01117.14
8.0.20.0140.00816.96
8.0.10.0000.00716.88
8.0.00.0070.01116.79
7.4.330.0020.00212.83
7.4.320.0060.00016.57
7.4.300.0060.00016.61
7.4.290.0060.00016.55
7.4.280.0000.00916.68
7.4.270.0000.00616.50
7.4.260.0030.00313.32
7.4.250.0040.00416.38
7.4.240.0000.00816.63
7.4.230.0000.00716.49
7.4.220.0060.00916.64
7.4.210.0090.01216.61
7.4.200.0000.00716.61
7.4.190.0040.00416.57
7.4.160.0120.00416.50
7.4.150.0090.00916.52
7.4.140.0090.00916.38
7.4.130.0160.00316.45
7.4.120.0090.01616.63
7.4.110.0090.00916.61
7.4.100.0140.00716.44
7.4.90.0080.01216.43
7.4.80.0120.00619.39
7.4.70.0140.00416.45
7.4.60.0060.00916.55
7.4.50.0060.00316.60
7.4.40.0060.00916.58
7.4.30.0070.01016.43
7.4.10.0000.01914.60
7.4.00.0080.01015.01
7.3.330.0000.00613.33
7.3.320.0030.00313.24
7.3.310.0040.00416.36
7.3.300.0030.00316.30
7.3.290.0070.00916.27
7.3.280.0070.01016.34
7.3.270.0210.00316.66
7.3.260.0140.00416.30
7.3.250.0110.01416.34
7.3.240.0140.00716.28
7.3.230.0100.00716.46
7.3.210.0070.01016.42
7.3.200.0080.00816.47
7.3.190.0030.01316.18
7.3.180.0030.01316.36
7.3.170.0130.00616.43
7.3.160.0030.01616.28
7.3.130.0100.00714.88
7.3.120.0070.01114.72
7.3.110.0070.01014.40
7.3.100.0060.00614.95
7.3.90.0030.01014.88
7.3.80.0030.01014.55
7.3.70.0000.01514.93
7.3.60.0080.00414.78
7.3.50.0030.01014.73
7.3.40.0060.00914.92
7.3.30.0060.01014.69
7.3.20.0060.00616.71
7.3.10.0080.00616.40
7.3.00.0030.00616.43
7.2.330.0060.01316.84
7.2.320.0090.00616.79
7.2.310.0040.02016.85
7.2.300.0060.01316.84
7.2.290.0100.01016.52
7.2.260.0040.01115.02
7.2.250.0110.00815.04
7.2.240.0110.00415.30
7.2.230.0040.01115.26
7.2.220.0070.00315.23
7.2.210.0070.00715.15
7.2.200.0100.00315.04
7.2.190.0030.00615.04
7.2.180.0060.00914.79
7.2.170.0080.00814.91
7.2.160.0060.00614.95
7.2.150.0150.00016.88
7.2.140.0000.01316.99
7.2.130.0080.00416.98
7.2.120.0070.00716.89
7.2.110.0110.00416.84
7.2.100.0000.01317.16
7.2.90.0000.01116.80
7.2.80.0070.00316.87
7.2.70.0110.00417.00
7.2.60.0080.00716.96
7.2.50.0030.01517.09
7.2.40.0060.00616.69
7.2.30.0060.00316.88
7.2.20.0040.01416.70
7.2.10.0030.01017.00
7.2.00.0050.00718.20
7.1.330.0040.00815.64
7.1.320.0110.00015.92
7.1.310.0040.01115.48
7.1.300.0030.01015.81
7.1.290.0090.00615.52
7.1.280.0150.00015.56
7.1.270.0000.01315.82
7.1.260.0000.01215.82
7.1.250.0100.00315.87
7.1.240.0040.01115.75
7.1.230.0000.00915.97
7.1.220.0070.00715.54
7.1.210.0060.00915.91
7.1.200.0070.00715.67
7.1.190.0040.01315.52
7.1.180.0120.00315.91
7.1.170.0090.00615.97
7.1.160.0030.00915.72
7.1.150.0040.01115.91
7.1.140.0000.01415.76
7.1.130.0030.00615.88
7.1.120.0040.01115.60
7.1.110.0030.00915.71
7.1.100.0030.01116.88
7.1.90.0070.00715.97
7.1.80.0040.01115.83
7.1.70.0040.00516.30
7.1.60.0080.01017.46
7.1.50.0060.01216.50
7.1.40.0030.01315.82
7.1.30.0030.01215.46
7.1.20.0070.00715.45
7.1.10.0090.00615.59
7.1.00.0030.02119.10
7.0.330.0060.00615.46
7.0.320.0070.00715.22
7.0.310.0060.00615.24
7.0.300.0060.00915.47
7.0.290.0090.00015.39
7.0.280.0060.00915.53
7.0.270.0060.00315.21
7.0.260.0070.00715.19
7.0.250.0060.00615.34
7.0.240.0040.00415.49
7.0.230.0080.00315.52
7.0.220.0000.01115.41
7.0.210.0070.00415.32
7.0.200.0020.00816.08
7.0.190.0100.00315.47
7.0.180.0070.01115.50
7.0.170.0060.00315.48
7.0.160.0070.00715.53
7.0.150.0000.01215.30
7.0.140.0070.03818.74
7.0.130.0090.00315.34
7.0.120.0030.04518.81
7.0.110.0080.02317.69
7.0.100.0090.02517.77
7.0.90.0070.04817.75
7.0.80.0030.04617.68
7.0.70.0070.04517.81
7.0.60.0110.03917.73
7.0.50.0050.04417.62
7.0.40.0050.02316.69
7.0.30.0100.03516.70
7.0.20.0060.04016.67
7.0.10.0030.02816.60
7.0.00.0030.02716.47
5.6.400.0000.01013.96
5.6.390.0070.00714.36
5.6.380.0090.00614.41
5.6.370.0030.00614.09
5.6.360.0030.01314.39
5.6.350.0040.00814.47
5.6.340.0060.00914.27
5.6.330.0040.00814.45
5.6.320.0110.00414.26
5.6.310.0070.00714.05
5.6.300.0000.01314.48
5.6.290.0040.00413.91
5.6.280.0070.03717.67
5.6.270.0090.00314.48
5.6.260.0080.01517.66
5.6.250.0060.03317.65
5.6.240.0120.03017.54
5.6.230.0060.02417.48
5.6.220.0050.03917.53
5.6.210.0050.03817.45
5.6.200.0070.03617.64
5.6.190.0070.02717.59
5.6.180.0060.03017.53
5.6.170.0050.02817.63
5.6.160.0060.05317.22
5.6.150.0100.04517.50
5.6.140.0030.04417.43
5.6.130.0050.02217.61
5.6.120.0060.03817.50
5.6.110.0100.02317.58
5.6.100.0050.04317.37
5.6.90.0030.04817.43
5.6.80.0030.02316.96
5.6.70.0080.04216.98
5.6.60.0050.04017.05
5.6.50.0030.02717.19
5.6.40.0150.03017.14
5.6.30.0050.02117.14
5.6.20.0120.01717.21
5.6.10.0050.04417.15
5.6.00.0040.01917.09
5.5.380.0050.04315.83
5.5.370.0080.04116.10
5.5.360.0090.03815.80
5.5.350.0100.03115.81
5.5.340.0030.05016.23
5.5.330.0080.02516.12
5.5.320.0070.02416.20
5.5.310.0070.03916.14
5.5.300.0050.04016.06
5.5.290.0040.02616.25
5.5.280.0030.04516.18
5.5.270.0060.03816.20
5.5.260.0080.03716.29
5.5.250.0030.04016.03
5.5.240.0000.03915.71
5.5.230.0040.02315.78
5.5.220.0040.03815.79
5.5.210.0040.02215.83
5.5.200.0070.02715.76
5.5.190.0100.01815.76
5.5.180.0050.04215.79
5.5.170.0030.00614.30
5.5.160.0100.03915.89
5.5.150.0050.02015.81
5.5.140.0090.02915.80
5.5.130.0070.04315.90
5.5.120.0030.03115.74
5.5.110.0050.02315.90
5.5.100.0050.04515.89
5.5.90.0020.03215.77
5.5.80.0070.03815.56
5.5.70.0020.04315.61
5.5.60.0020.03715.81
5.5.50.0060.03915.67
5.5.40.0030.03515.59
5.5.30.0000.02515.76
5.5.20.0110.03415.74
5.5.10.0030.02315.60
5.5.00.0080.03315.70
5.4.450.0030.03815.42
5.4.440.0000.02415.21
5.4.430.0070.03815.22
5.4.420.0050.02515.32
5.4.410.0050.03015.11
5.4.400.0040.04415.06
5.4.390.0080.03515.09
5.4.380.0030.02015.16
5.4.370.0030.02314.96
5.4.360.0050.01815.07
5.4.350.0060.02915.11
5.4.340.0030.03015.13
5.4.330.0000.00611.05
5.4.320.0060.02315.02
5.4.310.0040.03915.07
5.4.300.0030.03515.17
5.4.290.0050.03315.01
5.4.280.0030.02315.05
5.4.270.0020.04415.10
5.4.260.0090.02015.09
5.4.250.0130.01314.94
5.4.240.0030.02115.09
5.4.230.0090.03315.05
5.4.220.0050.03714.90
5.4.210.0090.02815.06
5.4.200.0060.03615.05
5.4.190.0070.02515.03
5.4.180.0050.02315.04
5.4.170.0000.02515.15
5.4.160.0050.02814.99
5.4.150.0030.04415.08
5.4.140.0020.02513.77
5.4.130.0100.03013.88
5.4.120.0070.03513.72
5.4.110.0100.03513.78
5.4.100.0060.01813.81
5.4.90.0030.02513.81
5.4.80.0050.02113.80
5.4.70.0030.02013.76
5.4.60.0020.02313.74
5.4.50.0070.02213.60
5.4.40.0060.02113.75
5.4.30.0030.02513.86
5.4.20.0020.02513.90
5.4.10.0020.02313.74
5.4.00.0030.02413.48
5.3.290.0020.03012.66
5.3.280.0030.04112.59
5.3.270.0060.03812.62
5.3.260.0050.01812.67
5.3.250.0070.03712.62
5.3.240.0000.03712.56
5.3.230.0030.04312.61
5.3.220.0030.03512.62
5.3.210.0080.03612.55
5.3.200.0030.04212.54
5.3.190.0040.01812.62
5.3.180.0080.01612.72
5.3.170.0020.02012.75
5.3.160.0050.01912.46
5.3.150.0030.02212.80
5.3.140.0080.01712.53
5.3.130.0050.02012.50
5.3.120.0060.02012.50
5.3.110.0070.01812.65
5.3.100.0040.01812.22
5.3.90.0100.01512.20
5.3.80.0020.02312.32
5.3.70.0080.01812.38
5.3.60.0060.02212.35
5.3.50.0020.02312.28
5.3.40.0060.02112.30
5.3.30.0070.02612.13
5.3.20.0030.02012.05
5.3.10.0050.01712.11
5.3.00.0010.02012.00
5.2.170.0100.02712.06
5.2.160.0000.03012.06
5.2.150.0000.03012.06
5.2.140.0030.03012.06
5.2.130.0070.02312.06
5.2.120.0000.03012.06
5.2.110.0000.04312.06
5.2.100.0000.03012.06
5.2.90.0000.03012.06
5.2.80.0030.03012.06
5.2.70.0070.02712.06
5.2.60.0000.03012.06
5.2.50.0000.03312.06
5.2.40.0000.03712.06
5.2.30.0030.03312.06
5.2.20.0000.03012.06
5.2.10.0000.03012.06
5.2.00.0030.02712.06
5.1.60.0070.02012.06
5.1.50.0000.02712.06
5.1.40.0000.02012.06
5.1.30.0030.02012.06
5.1.20.0000.02312.06
5.1.10.0030.02012.06
5.1.00.0000.02712.06
5.0.50.0070.02012.06
5.0.40.0000.01712.06
5.0.30.0030.02312.06
5.0.20.0000.01712.06
5.0.10.0030.01312.06
5.0.00.0030.02312.06
4.4.90.0030.01312.06
4.4.80.0000.01712.06
4.4.70.0030.01312.06
4.4.60.0000.01712.06
4.4.50.0070.01012.06
4.4.40.0000.02712.06
4.4.30.0030.01312.06
4.4.20.0000.01312.06
4.4.10.0070.00712.06
4.4.00.0000.02312.06
4.3.110.0000.01312.06
4.3.100.0030.01012.06
4.3.90.0000.01312.06
4.3.80.0000.02012.06
4.3.70.0000.01312.06
4.3.60.0030.01012.06
4.3.50.0030.01012.06
4.3.40.0030.02312.06
4.3.30.0000.01312.06
4.3.20.0000.01312.06
4.3.10.0000.01312.06
4.3.00.0000.01312.06

preferences:
39.02 ms | 401 KiB | 5 Q