3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getSearchResult($str, $query, $numOfWordToAdd) { $lowered = strtolower($query); $str = str_ireplace($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 5.0.0 - 7.1.0
array(2) { ["lowered"]=> string(7) "keyword" ["str"]=> string(56) "<p>This is the body, keyword to be searched is here.</p>" }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_ireplace() in /in/racvU on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_ireplace() in /in/racvU on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_ireplace() in /in/racvU on line 4