3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $value = "1234 4567 4568 4569 4560 3333AA 3334BB "; $allowedInputSeparators = array('\r\n', '\n', '\s', ',', ';', '|'); foreach($allowedInputSeparators as $separator) { echo "Testing "; var_dump($separator); if(preg_match($separator, $value)) { echo $separator . PHP_EOL; } }
Output for 4.3.11 - 7.1.0
Testing string(4) "\r\n" Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/VG2VJ on line 14 Testing string(2) "\n" Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/VG2VJ on line 14 Testing string(2) "\s" Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/VG2VJ on line 14 Testing string(1) "," Warning: preg_match(): No ending delimiter ',' found in /in/VG2VJ on line 14 Testing string(1) ";" Warning: preg_match(): No ending delimiter ';' found in /in/VG2VJ on line 14 Testing string(1) "|" Warning: preg_match(): No ending delimiter '|' found in /in/VG2VJ on line 14
Output for 4.3.0 - 4.3.10
Testing string(4) "\r\n" Warning: Delimiter must not be alphanumeric or backslash in /in/VG2VJ on line 14 Testing string(2) "\n" Warning: Delimiter must not be alphanumeric or backslash in /in/VG2VJ on line 14 Testing string(2) "\s" Warning: Delimiter must not be alphanumeric or backslash in /in/VG2VJ on line 14 Testing string(1) "," Warning: No ending delimiter ',' found in /in/VG2VJ on line 14 Testing string(1) ";" Warning: No ending delimiter ';' found in /in/VG2VJ on line 14 Testing string(1) "|" Warning: No ending delimiter '|' found in /in/VG2VJ on line 14