3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This should produce failures when using a version of libpcre older than 8.32 */ // Ignore versions other than 5.3-5.5 if (!preg_match('/^5\.[345]\./', phpversion())) { print "Don't care about this version\n"; exit(0); } error_reporting(E_ALL); ob_start(); phpinfo(); $phpinfo = ob_get_clean(); print preg_replace('/.*(PCRE Library Version => .*?$).*/sm', '$1', $phpinfo) . "\n"; $tests = array(); $test_string = mb_convert_encoding('&#xAC00;&#xAC01;&#x0BA8;&#x0BBF;', 'UTF-8', 'HTML-ENTITIES'); print "$test_string\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-8') === 4); $tests['string_match'] = (preg_match('/^\X\X\X$/u', $test_string) === 1); $fails = array(); foreach ($tests as $key => $value) { if ($value === false) { $fails[$key] = $value; } } if (count($fails) > 0) { echo "Failed: " . join(', ', array_keys($fails)) . "\n"; exit(1); } exit(0);

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)
7.2.00.0030.01019.61
7.1.100.0000.01318.21
7.1.70.0030.00517.24
7.1.60.0090.00917.50
7.1.50.0030.01716.89
7.1.00.0000.04022.55
7.0.200.0060.00916.75
7.0.140.0070.07021.95
7.0.60.0070.05719.84
7.0.50.0000.05317.87
7.0.40.0100.09020.11
7.0.30.0600.06320.21
7.0.20.0300.08020.34
7.0.10.0130.08020.18
7.0.00.0130.05720.22
5.6.280.0070.07021.07
5.6.210.0130.04020.77
5.6.200.0000.06318.18
5.6.190.0100.08020.41
5.6.180.0270.07020.35
5.6.170.0270.03320.50
5.6.160.0200.07720.32
5.6.150.0000.04018.18
5.6.140.0070.05318.21
5.6.130.0030.08318.22
5.6.120.0100.07021.11
5.6.110.0100.06021.15
5.6.100.0030.04020.99
5.6.90.0100.03721.11
5.6.80.0100.04720.39
5.5.350.0030.08320.45
5.5.340.0070.03717.98
5.5.330.0000.04720.14
5.5.320.0470.06720.41
5.5.310.0270.04020.27
5.5.300.0100.06017.91
5.5.290.0070.07318.02
5.5.280.0030.08020.98
5.5.270.0030.04020.72
5.5.260.0070.07320.74
5.5.250.0130.08020.70
5.5.240.0100.06020.19
5.4.450.0330.07319.23
5.4.440.0370.06719.41
5.4.430.0200.04019.11
5.4.420.0130.04319.40
5.4.410.0270.03319.45
5.4.400.0230.03319.09
5.4.390.0200.03718.88
5.4.380.0170.04018.78
5.4.370.0370.06719.06
5.4.360.0230.04319.08
5.4.350.0200.03718.93
5.4.340.0200.03319.09
5.4.320.0200.03719.25
5.4.310.0270.02719.08
5.4.300.0270.03018.79
5.4.290.0170.04719.09
5.4.280.0270.04719.26
5.4.270.0230.04719.12
5.4.260.0300.06719.06
5.4.250.0230.04019.07
5.4.240.0270.07018.88
5.4.230.0330.06719.21
5.4.220.0270.03319.21
5.4.210.0130.05019.08
5.4.200.0300.05718.78
5.4.190.0130.04319.12
5.4.180.0200.05019.12
5.4.170.0330.07019.12
5.4.160.0270.07318.90
5.4.150.0230.04019.21
5.4.140.0300.04316.31
5.4.130.0300.06016.23
5.4.120.0370.05716.35
5.4.110.0400.06316.39
5.4.100.0270.07316.51
5.4.90.0400.02716.35
5.4.80.0370.04716.34
5.4.70.0330.07016.42
5.4.60.0330.06016.04
5.4.50.0330.03316.20
5.4.40.0370.06016.36
5.4.30.0270.03316.45
5.4.20.0300.06716.36
5.4.10.0300.06716.37
5.4.00.0370.04015.91
5.3.290.0170.04314.66
5.3.280.0230.04314.45
5.3.270.0370.06314.46
5.3.260.0300.04314.46
5.3.250.0400.06014.45
5.3.240.0300.03314.57
5.3.230.0230.07314.47
5.3.220.0300.03314.42
5.3.210.0300.06714.53
5.3.200.0300.04714.53
5.3.190.0270.03314.43
5.3.180.0330.06714.51
5.3.170.0330.07014.43
5.3.160.0300.05314.42
5.3.150.0330.04314.48
5.3.140.0330.03714.66
5.3.130.0270.07714.54
5.3.120.0270.04314.39
5.3.110.0300.07014.65
5.3.100.0300.06313.96
5.3.90.0270.04313.86
5.3.80.0230.07313.89
5.3.70.0370.06313.81
5.3.60.0330.05713.98
5.3.50.0230.07713.92
5.3.40.0300.06713.84
5.3.30.0370.06014.02
5.3.20.0400.05713.64
5.3.10.0470.05313.71
5.3.00.0070.05313.38
5.2.170.0200.04711.10
5.2.160.0200.03710.99
5.2.150.0230.03311.02
5.2.140.0200.04711.05
5.2.130.0370.05011.05
5.2.120.0330.05011.05
5.2.110.0270.05710.97
5.2.100.0270.06011.27
5.2.90.0230.04011.03
5.2.80.0200.04711.05
5.2.70.0330.05710.96
5.2.60.0200.06011.11
5.2.50.0270.05310.89
5.2.40.0200.03310.85
5.2.30.0230.06010.85
5.2.20.0170.05010.81
5.2.10.0230.04010.77
5.2.00.0200.05710.64
5.1.60.0100.03010.18
5.1.50.0200.03010.13
5.1.40.0230.04310.11
5.1.30.0170.05710.31
5.1.20.0200.04010.33
5.1.10.0230.02310.01
5.1.00.0170.05710.17
5.0.50.0170.0309.69
5.0.40.0100.0479.69
5.0.30.0130.0609.69
5.0.20.0130.0209.69
5.0.10.0170.0409.69
5.0.00.0130.0439.69
4.4.90.0130.0109.69
4.4.80.0100.0339.69
4.4.70.0130.0309.69
4.4.60.0170.0309.69
4.4.50.0130.0209.69
4.4.40.0170.0439.69
4.4.30.0130.0279.69
4.4.20.0070.0309.69
4.4.10.0130.0339.69
4.4.00.0100.0609.69
4.3.110.0100.0209.69
4.3.100.0070.0209.69
4.3.90.0130.0339.69
4.3.80.0100.0579.69
4.3.70.0130.0239.69
4.3.60.0100.0209.69
4.3.50.0100.0339.69
4.3.40.0130.0509.69
4.3.30.0070.0339.69
4.3.20.0030.0339.69
4.3.10.0030.0309.69
4.3.00.0070.0309.69

preferences:
32.35 ms | 401 KiB | 5 Q