run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = <<<TEXT This is just some text, with something in the middle that has newlines around it. TEXT; $result = strpos($text, "\nsomething in the middle"); echo 'This works: '; var_dump($result); echo "\n<br>\n"; $buggy_result = strpos($text, "something in the middle\r"); echo 'This does not: '; var_dump($buggy_result);
Output for 4.3.0 - 5.6.22, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0RC4
This works: int(30) <br> This does not: bool(false)