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-8', 'HTML-ENTITIES'); print "$test_string\n"; print strlen($test_string) . "\n"; print mb_strlen($test_string, 'UTF-8') . "\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-8') === 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.4.10.0090.00915.00
7.4.00.0100.00815.19
7.3.130.0070.01114.55
7.3.120.0130.00514.97
7.3.110.0060.01214.91
7.3.100.0060.00915.07
7.3.90.0050.01014.97
7.3.80.0060.00614.92
7.3.70.0100.00314.89
7.3.60.0060.00914.79
7.3.50.0060.00714.88
7.3.40.0060.00914.96
7.3.30.0110.00414.89
7.3.20.0060.00416.91
7.3.10.0050.00816.70
7.3.00.0090.00416.68
7.2.260.0110.00715.02
7.2.250.0090.00915.20
7.2.240.0060.01215.25
7.2.230.0060.01015.05
7.2.220.0080.00515.20
7.2.210.0060.00915.22
7.2.200.0050.00915.15
7.2.190.0070.00514.99
7.2.180.0030.01115.03
7.2.170.0050.00715.11
7.2.160.0120.00615.21
7.2.150.0040.00716.89
7.2.140.0060.00616.98
7.2.130.0080.00616.83
7.2.120.0050.00816.83
7.2.110.0050.00917.01
7.2.100.0100.00516.81
7.2.90.0070.00816.97
7.2.80.0040.00916.88
7.2.70.0040.00816.88
7.2.60.0040.01016.88
7.2.50.0090.00616.86
7.2.40.0050.00816.89
7.2.30.0040.00817.12
7.2.20.0040.01017.05
7.2.10.0090.00617.01
7.2.00.0060.00917.60
7.1.330.0040.01015.83
7.1.320.0040.00815.76
7.1.310.0040.00815.79
7.1.300.0030.01115.83
7.1.290.0060.00515.99
7.1.280.0060.00715.86
7.1.270.0090.00515.95
7.1.260.0070.00615.94
7.1.250.0090.00515.84
7.1.240.0060.00616.00
7.1.230.0090.00415.77
7.1.220.0080.00815.79
7.1.210.0050.00815.62
7.1.200.0020.00915.98
7.1.190.0050.00915.83
7.1.180.0040.00815.53
7.1.170.0030.00815.71
7.1.160.0070.00515.67
7.1.150.0090.00615.73
7.1.140.0100.00415.82
7.1.130.0050.00815.69
7.1.120.0060.00615.90
7.1.110.0070.00615.79
7.1.100.0050.00816.62
7.1.90.0070.00715.63
7.1.80.0070.00515.89
7.1.70.0020.00916.19
7.1.60.0030.01016.37
7.1.50.0100.00616.22
7.1.40.0090.00816.08
7.1.30.0050.00816.02
7.1.20.0060.00616.17
7.1.10.0080.00316.08
7.1.00.0030.01116.12
7.0.330.0020.00715.24
7.0.320.0080.00415.56
7.0.310.0060.00715.52
7.0.300.0070.00715.47
7.0.290.0030.00815.36
7.0.280.0030.01015.54
7.0.270.0100.00115.42
7.0.260.0070.00715.54
7.0.250.0050.00515.56
7.0.240.0030.00915.60
7.0.230.0020.00815.42
7.0.220.0060.00715.40
7.0.210.0060.00415.37
7.0.200.0030.00915.90
7.0.190.0070.00615.90
7.0.180.0040.00615.69
7.0.170.0050.00715.69
7.0.160.0050.00615.82
7.0.150.0030.00815.71
7.0.140.0040.00815.77
7.0.130.0050.00615.92
7.0.120.0060.00616.09
7.0.110.0080.00515.70
7.0.100.0060.00615.87
7.0.90.0030.00915.17
7.0.80.0070.00915.83
7.0.70.0060.00515.68
7.0.60.0030.00915.72
7.0.50.0040.00915.74
7.0.40.0050.00813.79
7.0.30.0030.00913.87
7.0.20.0080.00313.83
7.0.10.0020.00813.96
7.0.00.0040.00814.01
5.6.400.0090.00014.34
5.6.390.0060.00314.54
5.6.380.0070.00914.36
5.6.370.0070.00714.41
5.6.360.0050.00814.32
5.6.350.0070.00314.13
5.6.340.0070.00514.34
5.6.330.0100.00414.57
5.6.320.0080.00514.29
5.6.310.0080.00314.13
5.6.300.0050.02416.46
5.6.290.0020.02916.42
5.6.280.0050.01716.53
5.6.270.0070.01616.66
5.6.260.0060.01716.46
5.6.250.0080.01916.62
5.6.240.0020.02116.55
5.6.230.0070.02016.46
5.6.220.0040.02016.45
5.6.210.0030.01916.41
5.6.200.0070.02716.41
5.6.190.0050.02016.46
5.6.180.0080.01916.54
5.6.170.0050.01816.47
5.6.160.0030.02316.53
5.6.150.0080.02416.38
5.6.140.0080.02216.46
5.6.130.0080.01616.46
5.6.120.0040.02016.36
5.6.110.0070.02316.43
5.6.100.0070.02716.56
5.6.90.0070.03316.42
5.6.80.0050.02116.23
5.6.70.0040.01916.06
5.6.60.0090.02916.29
5.6.50.0080.02016.22
5.6.40.0030.02216.23
5.6.30.0060.03216.23
5.6.20.0050.01816.22
5.6.10.0070.02016.27
5.6.00.0100.03116.17
5.5.380.0110.01514.36
5.5.370.0080.01714.40
5.5.360.0050.02114.35
5.5.350.0040.02214.46
5.5.340.0070.01514.56
5.5.330.0020.02114.42
5.5.320.0060.02214.51
5.5.310.0040.01714.46
5.5.300.0040.02014.50
5.5.290.0050.03214.61
5.5.280.0030.01914.63
5.5.270.0040.01914.48
5.5.260.0040.02314.61
5.5.250.0020.02914.54
5.5.240.0030.02714.33
5.5.230.0050.03314.27
5.5.220.0080.01714.29
5.5.210.0070.02214.24
5.5.200.0030.01814.38
5.5.190.0050.02014.30
5.5.180.0030.02714.38
5.5.170.0060.00112.87
5.5.160.0030.03014.11
5.5.150.0020.02114.33
5.5.140.0050.02514.27
5.5.130.0070.03114.33
5.5.120.0010.02514.28
5.5.110.0050.03014.29
5.5.100.0030.02114.13
5.5.90.0020.02014.13
5.5.80.0020.01914.21
5.5.70.0070.02814.18
5.5.60.0020.02114.34
5.5.50.0040.02014.22
5.5.40.0010.02014.18
5.5.30.0030.01814.37
5.5.20.0040.01814.31
5.5.10.0060.02714.22
5.5.00.0050.02314.12
5.4.450.0030.01814.36
5.4.440.0030.02114.33
5.4.430.0060.01514.27
5.4.420.0060.03314.40
5.4.410.0000.02214.17
5.4.400.0030.02614.10
5.4.390.0040.02314.12
5.4.380.0050.01814.15
5.4.370.0010.01814.09
5.4.360.0010.02314.17
5.4.350.0010.02214.21
5.4.340.0070.01514.16
5.4.330.0020.00511.74
5.4.320.0030.01814.14
5.4.310.0020.02914.20
5.4.300.0030.01914.11
5.4.290.0060.01314.09
5.4.280.0060.03114.13
5.4.270.0060.01514.19
5.4.260.0040.01514.17
5.4.250.0040.01914.16
5.4.240.0060.01614.11
5.4.230.0020.02314.09
5.4.220.0040.01714.17
5.4.210.0050.02214.18
5.4.200.0030.01714.11
5.4.190.0010.02414.15
5.4.180.0040.02714.09
5.4.170.0030.01914.14
5.4.160.0010.02014.14
5.4.150.0020.02014.10
5.4.140.0040.01713.39
5.4.130.0040.02713.36
5.4.120.0060.01613.35
5.4.110.0040.03013.38
5.4.100.0050.01613.43
5.4.90.0060.02913.43
5.4.80.0040.02813.32
5.4.70.0040.01613.31
5.4.60.0060.02713.27
5.4.50.0040.01813.30
5.4.40.0030.01513.37
5.4.30.0030.01513.31
5.4.20.0040.01913.36
5.4.10.0040.01413.28
5.4.00.0050.02413.14
5.3.290.0050.02812.75
5.3.280.0060.01412.75
5.3.270.0040.02912.75
5.3.260.0020.01912.75
5.3.250.0060.02512.75
5.3.240.0030.01812.75
5.3.230.0060.02712.75
5.3.220.0030.01512.75
5.3.210.0030.02612.75
5.3.200.0040.01612.75
5.3.190.0050.02412.75
5.3.180.0030.03112.75
5.3.170.0020.02112.75
5.3.160.0020.02012.75
5.3.150.0070.01712.75
5.3.140.0030.01712.75
5.3.130.0020.02012.75
5.3.120.0020.03312.75
5.3.110.0040.02212.75
5.3.100.0040.02612.75
5.3.90.0030.01812.75
5.3.80.0050.02412.75
5.3.70.0050.02112.75
5.3.60.0040.01612.75
5.3.50.0020.01712.75
5.3.40.0010.01912.75
5.3.30.0020.03012.75
5.3.20.0020.02412.75
5.3.10.0020.02312.75
5.3.00.0040.01912.75
5.2.170.0070.01412.96
5.2.160.0020.01612.96
5.2.150.0030.03612.96
5.2.140.0020.02012.96
5.2.130.0030.02712.96
5.2.120.0030.01712.96
5.2.110.0050.02912.96
5.2.100.0030.02612.96
5.2.90.0020.03312.96
5.2.80.0020.02412.96
5.2.70.0020.02312.96
5.2.60.0030.01712.96
5.2.50.0020.01812.96
5.2.40.0030.01712.96
5.2.30.0010.01912.96
5.2.20.0060.01312.96
5.2.10.0030.02812.96
5.2.00.0050.01612.96
5.1.60.0050.01112.96
5.1.50.0040.01312.96
5.1.40.0050.01512.96
5.1.30.0050.01312.96
5.1.20.0020.01612.96
5.1.10.0030.02412.96
5.1.00.0060.01612.96
5.0.50.0040.01012.96
5.0.40.0020.01312.96
5.0.30.0050.02612.96
5.0.20.0060.00912.96
5.0.10.0040.00912.96
5.0.00.0030.02412.96
4.4.90.0020.01012.96
4.4.80.0000.01112.96
4.4.70.0020.01212.96
4.4.60.0000.01212.96
4.4.50.0000.01012.96
4.4.40.0000.02312.96
4.4.30.0030.00812.96
4.4.20.0020.01912.96
4.4.10.0000.01112.96
4.4.00.0000.01512.96
4.3.110.0050.01112.96
4.3.100.0030.01012.96
4.3.90.0000.01012.96
4.3.80.0000.02612.96
4.3.70.0000.01712.96
4.3.60.0050.01712.96
4.3.50.0020.01312.96
4.3.40.0030.02512.96
4.3.30.0030.00812.96
4.3.20.0020.01612.96
4.3.10.0030.00812.96
4.3.00.0000.01412.96

preferences:
49.84 ms | 400 KiB | 5 Q