3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { interface FooInterface { public function foo(string $str); } } namespace Bar { use Foo\FooInterface; class BarClass implements FooInterface { public function foo(string $str) { } } if (version_compare(PHP_VERSION, '7.0', '<')) { function type_hint($code, $error) { if (strpos($error, 'string, string') !== false) { return true; } if (strpos($error, 'int, integer') !== false) { return true; } if (strpos($error, 'bool, boolean') !== false) { return true; } if (strpos($error, 'float, double') !== false) { return true; } return false; } set_error_handler('Bar\type_hint', E_RECOVERABLE_ERROR); function parse_error($code, $error) { print ' => ' . $code . ':' . $error; exit; } set_error_handler('Bar\parse_error', E_ERROR); } }

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.0090.00916.50
8.3.50.0110.00521.14
8.3.40.0110.00418.42
8.3.30.0090.01218.42
8.3.20.0080.00018.65
8.3.10.0050.00319.77
8.3.00.0070.00021.02
8.2.180.0070.00718.04
8.2.170.0210.00022.96
8.2.160.0140.00019.16
8.2.150.0050.00324.18
8.2.140.0000.00724.66
8.2.130.0030.00526.16
8.2.120.0030.00519.82
8.2.110.0100.00019.21
8.2.100.0090.00317.91
8.2.90.0050.00319.18
8.2.80.0040.00417.97
8.2.70.0050.00317.25
8.2.60.0090.00017.89
8.2.50.0030.00618.10
8.2.40.0070.00020.59
8.2.30.0050.00220.55
8.2.20.0040.00417.69
8.2.10.0000.00817.98
8.2.00.0000.00717.88
8.1.280.0090.00925.92
8.1.270.0040.00423.96
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.88
8.1.230.0120.00017.42
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0000.00917.35
8.1.190.0000.00817.13
8.1.180.0040.00418.10
8.1.170.0080.00018.62
8.1.160.0000.00719.01
8.1.150.0080.00018.95
8.1.140.0040.00419.52
8.1.130.0030.00317.61
8.1.120.0000.00717.49
8.1.110.0000.00817.28
8.1.100.0030.00317.30
8.1.90.0050.00317.33
8.1.80.0040.00417.42
8.1.70.0030.00317.22
8.1.60.0050.00217.45
8.1.50.0000.00817.38
8.1.40.0040.00417.48
8.1.30.0060.00317.43
8.1.20.0000.00817.59
8.1.10.0070.00017.23
8.1.00.0000.00717.19
8.0.300.0070.00018.77
8.0.290.0000.00716.63
8.0.280.0000.00718.38
8.0.270.0030.00317.20
8.0.260.0060.00317.14
8.0.250.0060.00016.80
8.0.240.0030.00316.96
8.0.230.0050.00216.77
8.0.220.0060.00316.75
8.0.210.0000.00716.85
8.0.200.0060.00016.79
8.0.190.0000.00816.88
8.0.180.0000.00716.84
8.0.170.0070.00016.84
8.0.160.0060.00316.76
8.0.150.0070.00016.83
8.0.140.0030.00716.66
8.0.130.0000.00613.27
8.0.120.0000.00816.86
8.0.110.0070.00016.77
8.0.100.0040.00416.83
8.0.90.0040.00416.67
8.0.80.0090.01216.73
8.0.70.0040.00316.89
8.0.60.0040.00416.82
8.0.50.0000.00716.83
8.0.30.0100.00716.94
8.0.20.0120.00817.40
8.0.10.0040.00416.99
8.0.00.0090.01016.60
7.4.330.0000.00515.08
7.4.320.0030.00316.37
7.4.300.0060.00016.57
7.4.290.0040.00816.56
7.4.280.0000.00816.44
7.4.270.0030.00316.56
7.4.260.0070.00316.46
7.4.250.0080.00016.45
7.4.240.0000.00716.57
7.4.230.0070.00016.41
7.4.220.0050.01816.41
7.4.210.0090.00616.58
7.4.200.0000.00716.28
7.4.160.0120.00316.56
7.4.150.0120.00617.40
7.4.140.0120.00617.86
7.4.130.0120.00616.44
7.4.120.0100.00816.27
7.4.110.0100.00716.38
7.4.100.0140.00316.49
7.4.90.0060.01116.27
7.4.80.0160.00719.39
7.4.70.0040.01216.32
7.4.60.0060.01316.57
7.4.50.0110.00416.45
7.4.40.0080.00816.71
7.4.30.0090.00916.32
7.4.00.0070.01014.85
7.3.330.0070.00013.03
7.3.320.0030.00313.05
7.3.310.0030.00516.02
7.3.300.0000.00716.05
7.3.290.0090.00616.21
7.3.280.0090.00716.21
7.3.270.0090.00917.40
7.3.260.0130.01016.39
7.3.250.0070.01116.25
7.3.240.0110.00716.47
7.3.230.0130.00316.39
7.3.210.0130.00316.46
7.3.200.0120.00416.42
7.3.190.0060.01116.31
7.3.180.0090.00616.33
7.3.170.0120.00616.50
7.3.160.0150.00616.29
7.2.330.0160.00316.71
7.2.320.0140.01116.54
7.2.310.0120.00816.62
7.2.300.0130.00916.41
7.2.290.0170.00316.41
7.2.60.0060.00616.67
7.1.200.0090.00615.71
7.1.70.0070.00016.97
7.1.60.0120.01220.41
7.1.50.0100.01016.62
7.1.00.0100.07022.41
7.0.200.0050.00316.41
7.0.60.0130.07021.77
7.0.50.0000.04317.88
7.0.40.0130.05720.39
7.0.30.0230.06320.39
7.0.20.0170.06020.37
7.0.10.0230.05020.25
7.0.00.0130.06020.28
5.6.280.0030.07321.11
5.6.210.0100.03720.76
5.6.200.0030.06018.18
5.6.190.0070.06721.12
5.6.180.0170.05721.18
5.6.170.0130.06021.20
5.6.160.0100.06321.14
5.6.150.0230.04721.07
5.6.140.0130.06321.15
5.6.130.0200.05721.17
5.6.120.0130.06021.07
5.6.110.0170.05321.10
5.6.100.0070.06321.16
5.6.90.0100.06321.02
5.6.80.0200.05020.49
5.6.70.0170.06020.50
5.6.60.0130.05720.53
5.6.50.0170.05720.51
5.6.40.0170.05720.43
5.6.30.0130.05720.46
5.6.20.0170.05320.47
5.6.10.0130.06020.47
5.6.00.0130.06020.54
5.5.350.0270.07020.40
5.5.340.0130.07318.09
5.5.330.0200.06320.88
5.5.320.0170.05721.00
5.5.310.0300.04320.88
5.5.300.0170.05720.86
5.5.290.0170.06320.84
5.5.280.0170.05720.89
5.5.270.0200.05020.89
5.5.260.0200.07720.84
5.5.250.0100.06020.52
5.5.240.0200.05020.25
5.5.230.0130.05720.27
5.5.220.0300.06020.18
5.5.210.0200.05720.27
5.5.200.0170.06020.25
5.5.190.0130.06320.27
5.5.180.0130.05720.25
5.5.160.0170.04720.27
5.5.150.0130.05320.20
5.5.140.0230.05020.19
5.5.130.0430.05020.25
5.5.120.0370.05020.38
5.5.110.0070.05720.21
5.5.100.0170.05320.17
5.5.90.0130.05020.17
5.5.80.0330.04720.28
5.5.70.0330.06320.16
5.5.60.0430.04320.15
5.5.50.0330.05320.19
5.5.40.0400.05020.03
5.5.30.0370.05020.15
5.5.20.0300.05020.10
5.5.10.0030.06320.14
5.5.00.0170.05020.11

preferences:
36.63 ms | 401 KiB | 5 Q