3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $mystring = "micha<?php </textarea>l' OR 1=1"; $findme = "="; $pos = strpos($mystring, $findme); // Note our use of ===. Simply == would not work as expected // because the position of 'a' was the 0th (first) character. if (strpos($mystring, $findme) === false) { //echo "The string '$findme' was not found in the string '$mystring'"; echo 'nenasiel som :('; } else { echo 'je tam'; //echo "The string '$findme' was found in the string '$mystring'"; //echo " and exists at position $pos"; } echo "\n"; echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10); echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "\n"; $forbiddenChar = array("<", ">", "'", "=", "--"); echo $forbiddenChar[0] . ", ". $forbiddenChar[1] . ", " . $forbiddenChar[2] . ", " . $forbiddenChar[3] . ", " . $forbiddenChar[4] . "\n"; $numberFound = 0; foreach(i in $forbiddenChar) { if (strpos($mystring, $forbiddenChar[i]) === false) { } else { // nieco som nasiel ++$numberFound; } } if ($numberFound > 0 ) { echo "nieco som nasiel\n"; } ?>
based on Qp7jM
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'in' (T_STRING) in /in/ngvQE on line 23
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_STRING in /in/ngvQE:23 Stack trace: #0 {main}
Process exited with code 255.