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;', 'UTF-8', 'HTML-ENTITIES'); print "$test_string\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-8') === 3); $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.0060.00619.57
7.1.100.0030.00618.07
7.1.70.0040.01217.26
7.1.60.0030.01617.50
7.1.50.0040.01716.87
7.1.40.0080.00416.77
7.1.30.0040.01416.67
7.1.20.0060.01216.90
7.1.10.0060.00616.52
7.1.00.0000.00816.96
7.0.200.0030.00616.54
7.0.190.0030.01216.80
7.0.180.0030.01716.18
7.0.170.0000.01016.36
7.0.160.0050.00816.46
7.0.150.0070.00316.56
7.0.140.0030.00816.44
7.0.130.0000.00916.67
7.0.120.0000.01116.61
7.0.110.0040.00416.63
7.0.100.0000.00716.43
7.0.90.0030.00916.50
7.0.80.0000.01016.53
7.0.70.0070.00416.52
7.0.60.0000.01616.11
7.0.50.0000.00816.41
7.0.40.0040.00415.86
7.0.30.0050.00515.86
7.0.20.0030.01315.86
7.0.10.0090.00315.86
7.0.00.0000.00815.86
5.6.300.0140.06120.83
5.6.290.0030.04420.83
5.6.280.0060.03820.87
5.6.270.0070.04120.82
5.6.260.0060.04421.07
5.6.250.0070.04220.90
5.6.240.0070.04720.93
5.6.230.0130.03220.86
5.6.220.0070.06920.95
5.6.210.0030.04020.64
5.6.200.0000.07720.77
5.6.190.0070.03720.83
5.6.180.0100.06320.99
5.6.170.0000.04421.03
5.6.160.0030.08120.81
5.6.150.0000.06020.77
5.6.140.0030.04520.86
5.6.130.0070.04121.04
5.6.120.0030.04820.76
5.6.110.0030.09120.94
5.6.100.0030.07321.02
5.6.90.0100.03920.85
5.6.80.0000.04220.40
5.6.70.0030.04020.21
5.6.60.0100.07220.23
5.6.50.0070.04320.30
5.6.40.0000.04220.34
5.6.30.0040.03920.21
5.6.20.0030.04320.13
5.6.10.0000.04620.09
5.6.00.0000.04520.21
5.5.380.0000.04417.46
5.5.370.0030.07917.44
5.5.360.0070.04517.45
5.5.350.0030.04217.56
5.5.340.0060.04017.97
5.5.330.0060.03817.97
5.5.320.0060.04018.03
5.5.310.0030.04018.07
5.5.300.0040.04017.95
5.5.290.0100.03617.94
5.5.280.0110.04617.94
5.5.270.0180.03618.02
5.5.260.0030.04217.85
5.5.250.0000.04817.64
5.5.240.0000.04417.39
5.5.230.0000.04817.21
5.5.220.0070.06917.23
5.5.210.0000.04217.13
5.5.200.0030.03817.37
5.5.190.0070.05317.41
5.5.180.0060.03817.18
5.5.160.0030.04017.05
5.5.150.0030.03917.38
5.5.140.0030.05317.37
5.5.130.0070.03717.38
5.5.120.0000.04017.31
5.5.110.0030.04017.38
5.5.100.0030.04617.29
5.5.90.0000.04017.11
5.5.80.0030.03917.18
5.5.70.0070.03416.95
5.5.60.0060.05417.28
5.5.50.0000.04217.26
5.5.40.0000.03917.31
5.5.30.0030.03617.25
5.5.20.0070.03417.29
5.5.10.0060.03817.30
5.5.00.0230.04317.21
5.4.450.0070.07219.41
5.4.440.0000.06819.26
5.4.430.0030.04619.20
5.4.420.0070.04119.20
5.4.410.0090.03519.07
5.4.400.0100.07619.17
5.4.390.0000.05519.17
5.4.380.0070.03819.12
5.4.370.0040.04219.06
5.4.360.0000.05218.98
5.4.350.0060.03418.97
5.4.340.0620.02919.05
5.4.320.0030.03818.98
5.4.310.0100.06818.88
5.4.300.0000.04018.97
5.4.290.0070.03618.88
5.4.280.0030.04019.18
5.4.270.0030.03919.07
5.4.260.0000.04318.85
5.4.250.0030.04218.91
5.4.240.0060.03419.03
5.4.230.0030.03719.07
5.4.220.0000.04518.88
5.4.210.0030.03519.03
5.4.200.0100.03319.06
5.4.190.0100.06118.84
5.4.180.0000.04718.90
5.4.170.0030.04019.13
5.4.160.0000.03918.86
5.4.150.0000.04319.09
5.4.140.0030.03616.70
5.4.130.0000.03616.45
5.4.120.0030.03416.56
5.4.110.0100.03016.59
5.4.100.0030.03716.59
5.4.90.0030.04616.63
5.4.80.0030.03416.70
5.4.70.0030.03616.68
5.4.60.0030.03316.64
5.4.50.0070.05016.48
5.4.40.0030.03516.65
5.4.30.0030.03516.43
5.4.20.0060.03116.55
5.4.10.0030.03416.47
5.4.00.0070.06616.06
5.3.290.0070.03615.86
5.3.280.0030.04015.86
5.3.270.0030.04315.86
5.3.260.0190.03215.86
5.3.250.0000.03815.86
5.3.240.0070.03115.86
5.3.230.0030.03915.86
5.3.220.0030.03415.86
5.3.210.0030.04615.86
5.3.200.0030.03415.86
5.3.190.0000.03915.86
5.3.180.0070.03315.86
5.3.170.0000.03815.86
5.3.160.0030.05915.86
5.3.150.0000.04515.86
5.3.140.0070.03315.86
5.3.130.0000.04115.86
5.3.120.0000.04015.86
5.3.110.0070.07515.86
5.3.100.0000.04315.86
5.3.90.0030.03615.86
5.3.80.0030.03715.86
5.3.70.0000.03715.86
5.3.60.0030.04315.86
5.3.50.0000.03715.86
5.3.40.0030.04115.86
5.3.30.0070.06215.86
5.3.20.0000.05015.86
5.3.10.0030.03115.86
5.3.00.0000.03815.86
5.2.170.0030.06615.86
5.2.160.0030.03515.86
5.2.150.0030.06515.86
5.2.140.0000.03915.86
5.2.130.0000.03315.86
5.2.120.0000.03015.86
5.2.110.0030.02915.86
5.2.100.0070.03015.86
5.2.90.0130.02415.86
5.2.80.0030.02815.86
5.2.70.0000.03215.86
5.2.60.0230.02315.86
5.2.50.0070.02615.86
5.2.40.0000.03215.86
5.2.30.0030.03115.86
5.2.20.0000.03315.86
5.2.10.0030.04915.86
5.2.00.0210.02415.86
5.1.60.0030.02415.86
5.1.50.0070.04915.86
5.1.40.0070.02415.86
5.1.30.0000.03715.86
5.1.20.0030.02915.86
5.1.10.0000.04415.86
5.1.00.0000.02715.86
5.0.50.0060.01815.86
5.0.40.0000.02215.86
5.0.30.0100.02315.86
5.0.20.0000.02215.86
5.0.10.0000.03315.86
5.0.00.0000.03215.86
4.4.90.0000.01715.86
4.4.80.0030.01515.86
4.4.70.0030.01415.86
4.4.60.0000.01715.86
4.4.50.0030.01315.86
4.4.40.0000.04915.86
4.4.30.0030.01815.86
4.4.20.0030.01315.86
4.4.10.0030.01315.86
4.4.00.0030.02315.86
4.3.110.0030.01715.86
4.3.100.0000.01715.86
4.3.90.0030.01315.86
4.3.80.0030.05315.86
4.3.70.0030.03815.86
4.3.60.0030.01515.86
4.3.50.0000.02215.86
4.3.40.0000.02915.86
4.3.30.0030.01815.86
4.3.20.0090.02215.86
4.3.10.0100.01715.86
4.3.00.0000.02015.86

preferences:
28.26 ms | 401 KiB | 5 Q