3v4l.org

run code in 200+ 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 7.2.0 - 7.2.6
Warning: Use of undefined constant content - assumed 'content' (this will throw an Error in a future version of PHP) in /in/1Y4EL on line 3 Notice: Trying to get property 'content' of non-object in /in/1Y4EL on line 5
Output for 5.0.0 - 7.1.20
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 4.3.0 - 4.4.9
Notice: Use of undefined constant content - assumed 'content' in /in/1Y4EL on line 3