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\n"); echo 'This does not: '; var_dump($buggy_result);
Output for 4.3.0 - 5.6.26, hhvm-3.10.0 - 3.14.4, 7.0.0 - 7.1.0RC3
This works: int(30) <br> This does not: int(31)