3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (version_compare(PHP_VERSION, '7.0.0', '<')) { define('BASIC_TYPE_HINT_REGEX', '#^Argument \d+ passed to .+? must be an instance of ([a-z]+), ([a-z]+) given#i'); function basic_type_hint($err_lvl, $err_msg) { if ($err_lvl == E_RECOVERABLE_ERROR) { if (preg_match(BASIC_TYPE_HINT_REGEX, $err_msg, $matches)) { if ($matches[1] == $matches[2]) { return true; } switch ($matches[1]) { case 'int': return $matches[2] == 'integer'; case 'bool': return $matches[2] == 'boolean'; default: return false; } } } return false; } set_error_handler('basic_type_hint'); } function foo(int $a) { print $a; } foo(42); foo(23);

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0060.00916.80
7.2.00.0000.01119.39
7.1.200.0090.00315.55
7.1.100.0040.00818.01
7.1.70.0060.00617.03
7.1.60.0100.01419.86
7.1.50.0130.01016.95
7.1.00.0030.07722.32
7.0.200.0050.00516.62
7.0.60.0200.07319.93
7.0.50.0030.04017.88
7.0.40.0070.04320.24
7.0.30.0270.05720.06
7.0.20.0470.06320.10
7.0.10.0030.04320.09
7.0.00.0030.08020.33
5.6.280.0070.07020.88
5.6.210.0170.06720.63
5.6.200.0030.06018.19
5.6.190.0000.05020.39
5.6.180.0470.07020.61
5.6.170.0070.04720.50
5.6.160.0030.05020.45
5.6.150.0130.05018.14
5.6.140.0030.06018.19
5.6.130.0130.03318.26
5.6.120.0100.08721.13
5.6.110.0100.08320.97
5.6.100.0030.08320.96
5.6.90.0030.07021.14
5.6.80.0030.06320.51
5.5.350.0200.05020.43
5.5.340.0070.05318.02
5.5.330.0100.08320.37
5.5.320.0330.07320.29
5.5.310.0270.05020.32
5.5.300.0070.08018.03
5.5.290.0100.03317.92
5.5.280.0030.04020.77
5.5.270.0330.05320.76
5.5.260.0170.07720.87
5.5.250.0030.04020.70
5.5.240.0030.03020.27
5.4.450.0570.05019.41
5.4.440.0630.05719.48
5.4.430.0100.05019.46
5.4.420.0070.05719.20
5.4.410.0270.04018.95
5.4.400.0130.04718.86
5.4.390.0170.04318.80
5.4.380.0070.05718.50
5.4.370.0200.04318.73
5.4.360.0070.06318.63
5.4.350.0070.05718.78
5.4.340.0130.06318.73
5.4.320.0070.05718.70
5.4.310.0070.05318.52
5.4.300.0070.05318.57
5.4.290.0200.04018.56
5.4.280.0170.04718.77
5.4.270.0070.05318.54
5.4.260.0130.04718.82
5.4.250.0170.04718.81
5.4.240.0130.05018.78
5.4.230.0170.04318.61
5.4.220.0130.05018.72
5.4.210.0170.05018.57
5.4.200.0100.04716.63
5.4.190.0100.05318.72
5.4.180.0100.05318.45
5.4.170.0200.04318.56
5.4.160.0030.05718.71
5.4.150.0000.06018.67
5.4.140.0000.06016.20
5.4.130.0100.04716.19
5.4.120.0270.05016.44
5.4.110.0000.05716.18
5.4.100.0170.04316.45
5.4.90.0130.04716.35
5.4.80.0100.04716.24
5.4.70.0100.05016.26
5.4.60.0070.05016.30
5.4.50.0030.05316.40
5.4.40.0200.04716.23
5.4.30.0030.05316.39
5.4.20.0030.05716.23
5.4.10.0070.05016.25
5.4.00.0030.05315.89
5.3.290.0300.04314.70
5.3.280.0100.05014.77
5.3.270.0070.05314.80
5.3.260.0130.05314.66
5.3.250.0170.05014.66
5.3.240.0170.04314.79
5.3.230.0100.05014.76
5.3.220.0200.04314.62
5.3.210.0070.05314.62
5.3.200.0130.04714.71
5.3.190.0030.05714.85
5.3.180.0100.05714.60
5.3.170.0070.05014.84
5.3.160.0070.05714.72
5.3.150.0000.06014.62
5.3.140.0070.05314.76
5.3.130.0100.05314.68
5.3.120.0200.04714.73
5.3.110.0100.05314.75
5.3.100.0100.05014.20
5.3.90.0130.04714.05
5.3.80.0030.05714.02
5.3.70.0070.05314.13
5.3.60.0130.04714.05
5.3.50.0130.04314.18
5.3.40.0070.05014.09
5.3.30.0170.04313.93
5.3.20.0100.04713.69
5.3.10.0030.05313.94
5.3.00.0100.06713.77
5.2.170.0030.05011.26
5.2.160.0070.04011.17
5.2.150.0070.04311.19
5.2.140.0130.03711.20
5.2.130.0030.04311.20
5.2.120.0070.04311.14
5.2.110.0030.04311.14
5.2.100.0070.04011.23
5.2.90.0100.04711.24
5.2.80.0100.03711.10
5.2.70.0000.05011.22
5.2.60.0070.04011.07
5.2.50.0070.04311.16
5.2.40.0130.03711.04
5.2.30.0070.04311.05
5.2.20.0100.04311.16
5.2.10.0030.04010.96
5.2.00.0030.04710.83
5.1.60.0100.03010.02
5.1.50.0070.03310.04
5.1.40.0070.03310.01
5.1.30.0030.03710.39
5.1.20.0030.03710.41
5.1.10.0030.03710.16
5.1.00.0030.03710.21
5.0.50.0000.0338.73
5.0.40.0000.0308.61
5.0.30.0100.0378.25
5.0.20.0000.0338.30
5.0.10.0000.0338.26
5.0.00.0100.0378.26
4.4.90.0000.0275.98
4.4.80.0030.0235.97
4.4.70.0070.0235.93
4.4.60.0000.0275.87
4.4.50.0070.0275.95
4.4.40.0030.0435.93
4.4.30.0030.0235.93
4.4.20.0030.0206.05
4.4.10.0070.0175.95
4.4.00.0030.0336.01
4.3.110.0070.0205.92
4.3.100.0030.0205.91
4.3.90.0000.0235.80
4.3.80.0070.0305.83
4.3.70.0070.0175.85
4.3.60.0030.0205.80
4.3.50.0000.0235.87
4.3.40.0070.0305.80
4.3.30.0100.0204.57
4.3.20.0030.0204.58
4.3.10.0030.0234.54
4.3.00.0070.0237.17