3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = "/\\s/"; $characters = array( 0x09 /*HT*/, 0x0A /*LF*/, 0x0B /*VT*/, 0x0C /*FF*/, 0x0D /*CR*/, 0x20 /*SP*/ ); foreach ($characters as $code) { echo sprintf("0x%02X: %s\n", $code, preg_match($pattern, chr($code))); }
Output for 5.4.41 - 5.4.45, 5.5.10 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
0x09: 1 0x0A: 1 0x0B: 1 0x0C: 1 0x0D: 1 0x20: 1
Output for 5.4.0 - 5.4.40, 5.5.0 - 5.5.9
0x09: 1 0x0A: 1 0x0B: 0 0x0C: 1 0x0D: 1 0x20: 1

preferences:
176.53 ms | 402 KiB | 387 Q