<?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;
Fatal error: Uncaught Error: Undefined constant "content" in /in/1Y4EL:3
Stack trace:
#0 {main}
thrown in /in/1Y4EL on line 3
Process exited with code 255.
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 7.3.32 - 7.3.33
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: 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.3.11, 4.4.0 - 4.4.9
Notice: Use of undefined constant content - assumed 'content' in /in/1Y4EL on line 3