3v4l.org

run code in 300+ PHP versions simultaneously
<?php $whitespaces = [ 'character tabulation' => "\u{0009}", 'line feed' => "\u{000A}", 'line tabulation' => "\u{000B}", 'form feed' => "\u{000C}", 'carriage return' => "\u{000D}", 'space' => "\u{0020}", 'next line' => "\u{0085}", 'no-break space' => "\u{00A0}", 'ogham space mark' => "\u{1680}", 'mongolian vowel separator' => "\u{180E}", 'en quad' => "\u{2000}", 'em quad' => "\u{2001}", 'en space' => "\u{2002}", 'em space' => "\u{2003}", 'three-per-em space' => "\u{2004}", 'four-per-em space' => "\u{2005}", 'six-per-em space' => "\u{2006}", 'figure space' => "\u{2007}", 'punctuation space' => "\u{2008}", 'thin space' => "\u{2009}", 'hair space' => "\u{200A}", 'zero width space' => "\u{200B}", 'zero width non-joiner' => "\u{200C}", 'zero width joiner' => "\u{200D}", 'line separator' => "\u{2028}", 'paragraph separator' => "\u{2029}", 'narrow no-break space' => "\u{202F}", 'medium mathematical space' => "\u{205F}", 'word joiner' => "\u{2060}", 'ideographic space' => "\u{3000}", 'zero width non-breaking space' => "\u{FEFF}" ]; $patterns = [ '/\s+/', '/\s+/u', '/\pZ+/u', '/\pC+/u', '/[\pZ\pC]+/u', '/[\x{0009}-\x{000D}\x{0020}\x{0085}\x{00A0}\x{1680}\x{180E}\x{2000}-\x{200D}\x{2028}-\x{202F}\x{205F}\x{2060}\x{3000}\x{FEFF}]+/ux', ]; printf("\n|%-30s |", 'whitespace characters'); foreach ($patterns as $pattern) { printf(" %-12s |", $pattern); } printf("\n|%s%s|", str_repeat('-', 31), str_repeat('|:' . str_repeat('-', 12) . ':', count($patterns))); foreach ($whitespaces as $name => $char) { printf("\n|%30s |", $name); foreach ($patterns as $pattern) { printf(" %-13s |", mb_strlen(preg_replace($pattern, '', $char)) ? '❌' : '✅'); } }

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.4.140.0130.00917.64
8.4.130.0080.00318.73
8.4.120.0110.00924.24
8.4.110.0130.00718.97
8.4.100.0120.00918.96
8.4.90.0130.00817.88
8.4.80.0140.00517.81
8.4.70.0140.00718.28
8.4.60.0100.00718.86
8.4.50.0140.00819.46
8.4.40.0030.01717.78
8.4.30.0150.00618.89
8.4.20.0070.01318.23
8.4.10.0140.00719.68
8.3.260.0100.01016.75
8.3.250.0090.01119.05
8.3.240.0110.01016.84
8.3.230.0140.00516.74
8.3.220.0110.00316.77
8.3.210.0110.00516.67
8.3.200.0060.00316.57
8.3.190.0130.00718.30
8.3.180.0120.00920.64
8.3.170.0080.00018.72
8.3.160.0050.00318.61
8.3.150.0110.00818.73
8.3.140.0060.00316.68
8.3.130.0030.00518.85
8.3.120.0060.00318.76
8.3.110.0030.00520.94
8.3.100.0030.00716.93
8.3.90.0040.00426.77
8.3.80.0110.00020.53
8.3.70.0100.01016.85
8.3.60.0060.00918.81
8.3.50.0140.00716.95
8.3.40.0100.00321.89
8.3.30.0090.01319.15
8.3.20.0060.00324.18
8.3.10.0030.00624.66
8.3.00.0060.00326.16
8.2.290.0120.00820.36
8.2.280.0090.01120.50
8.2.270.0070.01117.07
8.2.260.0030.00619.09
8.2.250.0090.00018.55
8.2.240.0030.00617.20
8.2.230.0060.00322.58
8.2.220.0060.01024.06
8.2.210.0040.00426.77
8.2.200.0070.00317.00
8.2.190.0060.01316.58
8.2.180.0170.00318.41
8.2.170.0090.00622.96
8.2.160.0070.01422.96
8.2.150.0140.00425.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0130.00717.75
8.2.110.0230.00022.09
8.2.100.0170.00320.73
8.2.90.0070.01420.76
8.2.80.0160.00720.83
8.2.70.0070.01120.90
8.2.60.0140.01019.02
8.2.50.0090.01318.93
8.2.40.0110.00718.99
8.2.30.0160.00618.94
8.2.20.0070.01018.91
8.2.10.0090.00619.09
8.2.00.0150.00619.08
8.1.330.0060.00421.73
8.1.320.0110.01216.54
8.1.310.0030.00616.79
8.1.300.0060.00318.54
8.1.290.0100.00030.84
8.1.280.0040.01825.92
8.1.270.0180.00024.66
8.1.260.0030.00526.35
8.1.250.0030.00628.09
8.1.240.0060.00318.74
8.1.230.0000.01018.74
8.1.220.0150.00618.81
8.1.210.0060.00320.19
8.1.200.0070.00318.75
8.1.190.0170.00318.55
8.1.180.0140.00318.51
8.1.170.0030.00620.52
8.1.160.0130.00320.36
8.1.150.0000.00920.66
8.1.140.0000.01220.40
8.1.130.0030.00720.56
8.1.120.0070.01418.85
8.1.110.0070.00318.76
8.1.100.0030.00618.72
8.1.90.0030.00618.75
8.1.80.0100.00018.68
8.1.70.0140.00018.76
8.1.60.0100.00018.98
8.1.50.0070.00318.84
8.1.40.0070.01118.84
8.1.30.0030.00718.90
8.1.20.0060.00318.90
8.1.10.0120.00318.59
8.1.00.0050.00518.87
8.0.300.0090.00018.19
8.0.290.0040.01117.92
8.0.280.0070.01118.20
8.0.270.0030.00618.23
8.0.260.0090.00018.15
8.0.250.0030.00618.32
8.0.240.0060.00618.12
8.0.230.0090.00018.18
8.0.220.0070.00318.20
8.0.210.0060.00318.21
8.0.200.0060.00318.19
8.0.190.0090.00018.14
8.0.180.0060.00318.12
8.0.170.0050.00518.12
8.0.160.0030.00618.21
8.0.150.0030.00618.09
8.0.140.0030.00618.18
8.0.130.0030.00618.10
8.0.120.0070.00318.08
8.0.110.0090.00018.10
8.0.100.0160.00618.16
8.0.90.0110.00818.14
8.0.80.0100.00018.25
8.0.70.0060.00318.13
8.0.60.0100.00017.98
8.0.50.0070.00718.13
8.0.30.0090.00018.12
8.0.20.0030.01018.21
8.0.10.0000.00918.29
5.6.00.0140.00815.56
5.5.380.0170.00515.85

preferences:
79.14 ms | 403 KiB | 5 Q