3v4l.org

run code in 300+ PHP versions simultaneously
<?php $whitespace = array( "\u0009" => 'character tab', "\u000a" => 'line feed', "\u000b" => 'line tab', "\u000c" => 'form feed', "\u000d" => 'carriage return', "\u0020" => 'space', "\u0085" => 'next line', "\u00A0" => 'non-breaking space', "\u1680" => 'ogham space', "\u2000" => 'en quad', "\u2001" => 'em quad', "\u2002" => 'en space', "\u2003" => 'em space', "\u2004" => 'three-per-em space', "\u2005" => 'four-per-em space', "\u2006" => 'six-per-em space', "\u2007" => 'figure space', "\u2008" => 'punctuation space', "\u2009" => 'thin space', "\u200a" => 'hair space', "\u2028" => 'line separator', "\u2029" => 'paragraph separator', "\u202f" => 'narrow non-breaking space', "\u205f" => 'medium mathematical space', "\u3000" => 'ideographic space' ); foreach ($whitespace as $char => $name) { $dec = json_decode('"'.$char.'"'); $test = "a{$dec}b"; $test = preg_replace('/\s+/', '', $test); //echo "$name: a{$char}b == $test\n"; if ($test != "ab") { echo "$char ($name) is not matched as whitespace\n"; } }

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)
8.3.60.0040.01118.68
8.3.50.0120.00721.36
8.3.40.0070.01419.09
8.3.30.0200.00018.95
8.3.20.0040.00420.20
8.3.10.0040.00420.61
8.3.00.0100.00019.31
8.2.180.0040.01116.50
8.2.170.0060.00922.96
8.2.160.0090.00618.80
8.2.150.0080.00024.18
8.2.140.0090.00624.66
8.2.130.0000.00826.16
8.2.120.0070.00022.18
8.2.110.0030.00619.30
8.2.100.0060.00617.97
8.2.90.0030.00619.22
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0040.00418.04
8.2.50.0050.00318.10
8.2.40.0030.00618.05
8.2.30.0000.00819.17
8.2.20.0040.00417.81
8.2.10.0090.00018.04
8.2.00.0040.00417.76
8.1.280.0100.00325.92
8.1.270.0040.00423.96
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00323.97
8.1.230.0070.00717.70
8.1.220.0040.00417.78
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0050.00318.59
8.1.160.0040.00421.99
8.1.150.0070.00018.77
8.1.140.0000.00717.50
8.1.130.0070.00017.84
8.1.120.0040.00417.63
8.1.110.0070.00017.63
8.1.100.0000.00717.57
8.1.90.0070.00017.64
8.1.80.0000.00717.61
8.1.70.0050.00217.54
8.1.60.0000.01017.75
8.1.50.0050.00517.70
8.1.40.0050.00317.57
8.1.30.0000.00817.73
8.1.20.0030.00617.78
8.1.10.0000.01017.57
8.1.00.0000.00817.61
8.0.300.0070.00418.77
8.0.290.0000.01016.88
8.0.280.0040.00418.39
8.0.270.0040.00417.27
8.0.260.0000.00617.18
8.0.250.0040.00416.98
8.0.240.0060.00317.14
8.0.230.0030.00417.12
8.0.220.0030.00316.98
8.0.210.0070.00017.03
8.0.200.0040.00417.07
8.0.190.0070.00017.05
8.0.180.0000.00717.03
8.0.170.0040.00416.97
8.0.160.0050.00216.97
8.0.150.0020.00517.03
8.0.140.0030.00416.93
8.0.130.0060.00013.45
8.0.120.0030.00516.98
8.0.110.0000.00717.04
8.0.100.0000.00717.02
8.0.90.0070.00016.98
8.0.80.0030.01216.91
8.0.70.0050.00316.90
8.0.60.0000.00716.95
8.0.50.0050.00216.97
8.0.30.0120.00917.20
8.0.20.0130.00617.40
8.0.10.0070.00017.26
8.0.00.0040.01317.02
7.4.330.0050.00015.18
7.4.320.0030.00316.75
7.4.300.0000.00716.75
7.4.290.0000.00716.70
7.4.280.0040.00416.68
7.4.270.0000.00716.61
7.4.260.0000.00716.79
7.4.250.0050.00216.81
7.4.240.0010.00616.79
7.4.230.0070.00016.69
7.4.220.0150.00916.87
7.4.210.0100.00716.76
7.4.200.0070.00016.82
7.4.160.0090.01316.68
7.4.150.0120.00617.40
7.4.140.0100.00817.86
7.4.130.0070.01216.69
7.4.120.0060.01116.58
7.4.110.0090.01016.68
7.4.100.0060.01016.61
7.4.90.0080.01516.71
7.4.80.0100.01319.37
7.4.70.0120.00616.66
7.4.60.0070.01616.71
7.4.50.0000.00816.76
7.4.40.0090.00616.73
7.4.30.0080.00816.64
7.4.00.0090.00615.33
7.3.330.0030.00613.30
7.3.320.0050.00013.28
7.3.310.0070.00016.47
7.3.300.0070.00016.36
7.3.290.0090.00616.49
7.3.280.0090.00816.50
7.3.270.0150.00317.40
7.3.260.0140.00316.82
7.3.250.0080.01116.67
7.3.240.0090.01216.41
7.3.230.0100.00716.73
7.3.210.0070.01116.37
7.3.200.0100.01319.39
7.3.190.0030.01516.60
7.3.180.0130.00316.43
7.3.170.0100.00716.85
7.3.160.0080.00816.73
7.2.330.0070.01116.71
7.2.320.0110.00616.75
7.2.310.0060.01016.61
7.2.300.0120.01216.64
7.2.290.0130.00516.79
7.2.60.0030.01417.20
7.2.00.0060.00619.65
7.1.200.0150.00615.92
7.1.100.0000.01118.14
7.1.70.0050.00317.48
7.1.60.0150.00719.32
7.1.50.0070.01517.26
7.1.00.0030.07322.36
7.0.200.0040.00717.03
7.0.140.0000.07722.21
7.0.60.0070.06720.07
7.0.50.0030.06317.84
7.0.40.0130.04020.38
7.0.30.0200.07020.18
7.0.20.0230.08320.11
7.0.10.0070.06020.03
7.0.00.0100.05020.18
5.6.280.0100.06720.78
5.6.210.0070.07320.70
5.6.200.0070.06018.13
5.6.190.0070.05020.48
5.6.180.0400.05020.56
5.6.170.0370.06020.42
5.6.160.0030.09020.70
5.6.150.0070.07718.18
5.6.140.0030.04318.18
5.6.130.0200.07018.23
5.6.120.0100.06020.76
5.6.110.0030.08721.06
5.6.100.0000.04321.01
5.6.90.0170.07020.88
5.6.80.0070.06320.48
5.5.350.0170.06020.39
5.5.340.0100.08018.01
5.5.330.0100.08320.23
5.5.320.0430.06720.31
5.5.310.0230.08320.28
5.5.300.0070.06317.90
5.5.290.0130.08017.90
5.5.280.0030.04020.77
5.5.270.0130.07720.72
5.5.260.0100.08020.87
5.5.250.0070.05720.64
5.5.240.1530.04020.26
5.4.450.0600.03719.39
5.4.440.0900.06719.55
5.4.430.0970.07019.58
5.4.420.0670.00019.48
5.4.410.0630.00019.28
5.4.400.0670.00019.05
5.4.390.0800.00019.07
5.4.380.0330.05318.69
5.4.370.0500.04718.68
5.4.360.0400.05718.78
5.4.350.0270.06718.55
5.4.340.0400.04318.72
5.4.320.0080.03412.47
5.4.310.0080.04112.46
5.4.300.0080.03412.47
5.4.290.0100.03312.46
5.4.280.0070.03412.36
5.4.270.0080.03612.36
5.4.260.0070.04112.36
5.4.250.0030.04512.36
5.4.240.0080.04112.36
5.4.230.0050.04712.36
5.4.220.0080.04512.36
5.4.210.0080.03312.35
5.4.200.0070.05012.36
5.4.190.0030.03712.35
5.4.180.0080.03812.35
5.4.170.0050.03712.36
5.4.160.0080.03412.36
5.4.150.0040.03812.36
5.4.140.0030.04012.04
5.4.130.0070.04512.03
5.4.120.0050.03911.98
5.4.110.0090.03111.98
5.4.100.0030.03811.98
5.4.90.0050.03711.98
5.4.80.0080.04511.98
5.4.70.0060.04211.98
5.4.60.0080.03211.98
5.4.50.0050.03511.98
5.4.40.0060.04711.96
5.4.30.0070.03511.96
5.4.20.0080.05611.96
5.4.10.0060.03611.96
5.4.00.0060.03611.45
5.3.290.0060.04112.80
5.3.280.0070.03612.71
5.3.270.0040.04412.72
5.3.260.0060.03912.71
5.3.250.0070.03712.72
5.3.240.0080.03512.71
5.3.230.0050.03812.71
5.3.220.0040.03812.68
5.3.210.0050.04012.68
5.3.200.0030.03812.68
5.3.190.0050.04112.68
5.3.180.0050.03712.67
5.3.170.0040.04112.67
5.3.160.0030.03912.67
5.3.150.0060.03612.67
5.3.140.0080.03312.66
5.3.130.0080.03612.66
5.3.120.0090.04612.66
5.3.110.0080.04112.66
5.3.100.0090.03312.12
5.3.90.0050.03612.09
5.3.80.0070.03412.07
5.3.70.0050.03612.07
5.3.60.0100.03712.06
5.3.50.0110.03112.00
5.3.40.0040.03812.00
5.3.30.0060.03811.96
5.3.20.0060.03711.73
5.3.10.0060.03511.70
5.3.00.0080.03911.69
5.2.170.0050.0309.18
5.2.160.0040.0299.19
5.2.150.0060.0299.19
5.2.140.0070.0309.18
5.2.130.0050.0299.14
5.2.120.0070.0259.14
5.2.110.0040.0299.15
5.2.100.0050.0299.15
5.2.90.0060.0279.14
5.2.80.0070.0279.14
5.2.70.0040.0319.14
5.2.60.0050.0339.09
5.2.50.0060.0319.07
5.2.40.0060.0279.05
5.2.30.0060.0299.02
5.2.20.0040.0289.02
5.2.10.0080.0258.93
5.2.00.0030.0308.79
5.1.60.0040.0248.08
5.1.50.0050.0268.07
5.1.40.0050.0248.06
5.1.30.0030.0278.41
5.1.20.0020.0348.43
5.1.10.0030.0288.16
5.1.00.0040.0288.16
5.0.50.0030.0226.63
5.0.40.0030.0206.50
5.0.30.0060.0346.30
5.0.20.0060.0186.28
5.0.10.0050.0186.26
5.0.00.0030.0316.25
4.4.90.0010.0204.78
4.4.80.0010.0164.75
4.4.70.0020.0164.75
4.4.60.0040.0144.75
4.4.50.0020.0174.77
4.4.40.0040.0244.70
4.4.30.0000.0184.75
4.4.20.0030.0164.84
4.4.10.0030.0154.84
4.4.00.0010.0264.76
4.3.110.0010.0174.67
4.3.100.0050.0174.66
4.3.90.0030.0154.64
4.3.80.0010.0264.58
4.3.70.0010.0154.63
4.3.60.0000.0174.63
4.3.50.0040.0144.63
4.3.40.0020.0264.53
4.3.30.0030.0163.30
4.3.20.0040.0173.27
4.3.10.0010.0173.23
4.3.00.0200.01714.30

preferences:
43.06 ms | 401 KiB | 5 Q