3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $query = "Google"; $elasticaResult = array(content=>"Google Account, you need to have JavaScript enabled in your browser. Refresh this page after you have enabled JavaScript. Create a new Google Account Name First name First Last name Last"); $queryReplace = "<span class=\"found\">".$query."</span>"; $descriptionContent = $elasticaResult->content; $foundQuery = stristr($descriptionContent, $query); $queryInDescription = str_replace($query, $queryReplace, $foundQuery); echo $queryInDescription;
Output for 5.0.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Use of undefined constant content - assumed 'content' in /in/1Y4EL on line 3 Notice: Trying to get property of non-object in /in/1Y4EL on line 5
Output for hhvm-3.12.0
Notice: Use of undefined constant content - assumed 'content' in /in/1Y4EL on line 3 Notice: Cannot access property on non-object in /in/1Y4EL on line 5 Warning: stristr() expects parameter 1 to be string, null given in /in/1Y4EL on line 6
Output for hhvm-3.10.0
Notice: Use of undefined constant content - assumed 'content' in /in/1Y4EL on line 3 Notice: Cannot access property on non-object in /in/1Y4EL on line 5
Output for 4.3.0 - 4.4.9
Notice: Use of undefined constant content - assumed 'content' in /in/1Y4EL on line 3