3v4l.org

run code in 300+ PHP versions simultaneously
<?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.4.0 - 5.4.15
Parse error: syntax error, unexpected '"content"' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in GnED9 on line 5
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '{' or '$' in /in/cDWDP on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '{' or '$' in GnED9 on line 5
Process exited with code 255.

preferences:
185.27 ms | 1399 KiB | 49 Q