3v4l.org

run code in 200+ 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.10 - 4.4.9, 5.0.2 - 7.3.0rc4
Testing string(4) "\r\n" Testing string(2) "\n" \n Testing string(2) "\s" \s Testing string(1) "," Testing string(1) ";" Testing string(1) "|" |
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Testing string(4) "\r\n" Testing string(2) "\n" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/STLjg on line 15 \nPHP_EOLTesting string(2) "\s" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/STLjg on line 15 \sPHP_EOLTesting string(1) "," Testing string(1) ";" Testing string(1) "|" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/STLjg on line 15 |PHP_EOL