3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $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 5.0.4 - 7.1.0
Notice: Undefined variable: text in /in/tvjlY on line 3 This works: bool(false) <br> Notice: Undefined variable: text in /in/tvjlY on line 8 This does not: bool(false)
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: text in /in/tvjlY on line 3 This works: bool(false) <br> Notice: Undefined variable: text in /in/tvjlY on line 8 This does not: bool(false)