3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getSearchResult($str, $query, $numOfWordToAdd) { $lowered = strtolower($query); $str = stri_replace($query,$lowered,$str); var_dump(array('lowered' => $lowered, 'str' => $str)); list($before, $after) = explode($lowered, $str); } $body = "<p>This is the body, KeyWoRd to be searched is here.</p>"; $keyword = "kEyword"; echo getSearchResult($body,$keyword,1); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function stri_replace() in /in/s79BG:4 Stack trace: #0 /in/s79BG(13): getSearchResult('<p>This is the ...', 'kEyword', 1) #1 {main} thrown in /in/s79BG on line 4
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function stri_replace() in /in/s79BG on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: stri_replace() in /in/s79BG on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: stri_replace() in /in/s79BG on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: stri_replace() in /in/s79BG on line 4