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('&#x0BA8;&#x0BBF;', 'UTF-32', 'HTML-ENTITIES'); print "$test_string\n"; print strlen($test_string) . "\n"; print mb_strlen($test_string, 'UTF-32') . "\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-32') === 1); $tests['string_match'] = (preg_match('/^\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.0000.01619.54
7.1.100.0040.00718.09
7.1.70.0000.00917.21
7.1.60.0070.00417.32
7.1.50.0100.01016.81
7.1.00.0030.06322.32
7.0.200.0060.00616.88
7.0.140.0130.06322.15
7.0.60.0270.07320.09
7.0.50.0070.08317.94
7.0.40.0100.04717.71
7.0.30.0000.07717.68
7.0.20.0000.05717.86
7.0.10.0100.07717.71
7.0.00.0070.06717.80
5.6.280.0070.07020.86
5.6.210.0170.06320.76
5.6.200.0070.06718.16
5.6.190.0130.07018.18
5.6.180.0030.07018.08
5.6.170.0070.08018.15
5.6.160.0070.04018.09
5.6.150.0100.05318.11
5.6.140.0100.07718.17
5.6.130.0000.06018.20
5.6.120.0070.08318.15
5.6.110.0130.07718.08
5.6.100.0130.06318.11
5.6.90.0100.07018.10
5.6.80.0030.08317.50
5.6.70.0030.07717.56
5.6.60.0070.05317.49
5.6.50.0130.03017.60
5.6.40.0070.07017.46
5.6.30.0170.06717.45
5.6.20.0100.07317.50
5.6.10.0070.07317.51
5.6.00.0070.07717.45
5.5.350.0130.06020.48
5.5.340.0100.05317.84
5.5.330.0070.06017.77
5.5.320.0130.05017.77
5.5.310.0130.05018.12
5.5.300.0100.05318.09
5.5.290.0030.06717.89
5.5.280.0030.06318.02
5.5.270.0130.05318.26
5.5.260.0100.05718.24
5.5.250.0200.05017.80
5.5.240.0070.05317.48
5.5.230.0100.05317.14
5.5.220.0130.04717.34
5.5.210.0030.05317.22
5.5.200.0130.05317.20
5.5.190.0070.05717.19
5.5.180.0070.05317.21
5.5.160.0200.04317.47
5.5.150.0070.06017.11
5.5.140.0200.06317.29
5.5.130.0130.04717.24
5.5.120.0130.04317.19
5.5.110.0030.05717.23
5.5.100.0100.05317.15
5.5.90.0030.05717.34
5.5.80.0200.04317.14
5.5.70.0100.06017.37
5.5.60.0070.05017.51
5.5.50.0170.04317.49
5.5.40.0200.06717.39
5.5.30.0200.04017.26
5.5.20.0100.06017.18
5.5.10.0070.05717.11
5.5.00.0100.05317.22
5.4.450.0200.05319.20
5.4.440.0030.06019.17
5.4.430.0100.06319.36
5.4.420.0030.06019.15
5.4.410.0130.05019.07
5.4.400.0170.05018.94
5.4.390.0230.04718.91
5.4.380.0100.06319.04
5.4.370.0100.06718.81
5.4.360.0230.04718.89
5.4.350.0200.03718.83
5.4.340.0070.05718.87
5.4.320.0130.06318.85
5.4.310.0130.04718.77
5.4.300.0170.05718.88
5.4.290.0070.05318.94
5.4.280.0030.06018.88
5.4.270.0100.07018.92
5.4.260.0130.06018.88
5.4.250.0130.04318.88
5.4.240.0100.05319.03
5.4.230.0170.04318.86
5.4.220.0100.05318.86
5.4.210.0070.05318.86
5.4.200.0170.04718.79
5.4.190.0100.04718.79
5.4.180.0070.05318.81
5.4.170.0130.05719.02
5.4.160.0130.06719.02
5.4.150.0100.05318.87
5.4.140.0130.04316.23
5.4.130.0000.05316.21
5.4.120.0000.06316.21
5.4.110.0100.08016.32
5.4.100.0030.05716.39
5.4.90.0100.05016.14
5.4.80.0030.05316.17
5.4.70.0070.05016.34
5.4.60.0270.03316.17
5.4.50.0100.04315.96
5.4.40.0130.05016.39
5.4.30.0200.05016.31
5.4.20.0030.05016.33
5.4.10.0070.05316.30
5.4.00.0030.05315.74
5.3.290.0100.05014.44
5.3.280.0070.05714.46
5.3.270.0170.04714.42
5.3.260.0070.05314.34
5.3.250.0130.04714.49
5.3.240.0100.04714.47
5.3.230.0100.04714.41
5.3.220.0100.05014.38
5.3.210.0100.05014.38
5.3.200.0170.07014.38
5.3.190.0070.05314.43
5.3.180.0070.05014.32
5.3.170.0070.05314.38
5.3.160.0130.04314.32
5.3.150.0070.05014.43
5.3.140.0030.05714.34
5.3.130.0170.04714.36
5.3.120.0130.06014.31
5.3.110.0230.04014.41
5.3.100.0000.06013.91
5.3.90.0170.05713.91
5.3.80.0170.04313.75
5.3.70.0100.05713.89
5.3.60.0170.04313.86
5.3.50.0030.05013.75
5.3.40.0000.05713.68
5.3.30.0030.05713.60
5.3.20.0100.05013.46
5.3.10.0070.05013.46
5.3.00.0100.05013.41
5.2.170.0030.03311.32
5.2.160.0030.02711.19
5.2.150.0030.02710.99
5.2.140.0000.03311.05
5.2.130.0000.03011.11
5.2.120.0070.03311.15
5.2.110.0030.02711.26
5.2.100.0000.03011.07
5.2.90.0000.03011.05
5.2.80.0000.03011.13
5.2.70.0070.02310.90
5.2.60.0000.03011.06
5.2.50.0030.02710.86
5.2.40.0030.02710.91
5.2.30.0030.03010.90
5.2.20.0030.02710.89
5.2.10.0030.02710.82
5.2.00.0030.02710.71
5.1.60.0000.02310.00
5.1.50.0030.0239.96
5.1.40.0000.0239.97
5.1.30.0030.02310.41
5.1.20.0000.02710.39
5.1.10.0030.02310.02
5.1.00.0000.0279.91
5.0.50.0000.0208.59
5.0.40.0000.0238.45
5.0.30.0070.0238.31
5.0.20.0070.0138.20
5.0.10.0000.0208.09
5.0.00.0000.0308.00
4.4.90.0030.0136.84
4.4.80.0000.0136.84
4.4.70.0000.0176.88
4.4.60.0030.0136.89
4.4.50.0030.0136.89
4.4.40.0030.0236.90
4.4.30.0000.0176.90
4.4.20.0000.0176.90
4.4.10.0030.0136.90
4.4.00.0000.0276.90
4.3.110.0030.0136.90
4.3.100.0000.0176.91
4.3.90.0000.0136.92
4.3.80.0070.0176.94
4.3.70.0000.0136.95
4.3.60.0000.0176.95
4.3.50.0000.0136.96
4.3.40.0000.0236.97
4.3.30.0000.0136.98
4.3.20.0000.0176.98
4.3.10.0000.0136.98
4.3.00.0000.0176.98

preferences:
68.76 ms | 400 KiB | 5 Q