3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = "aa\" b \x27 c"; $sum = 0; $inputs = explode("\n", $input); for($i = 0; $i<count($inputs); $i++){ $ns = addslashes($inputs[$i]); echo preg_match(preg_match("/\\[^\"]/",$ns); for($j = 0; $j<strlen($ns); $j++){ $sum++; echo $ns[$j]."|"; } if(preg_match("/\\[^\"]/",$ns)>0){ $sum+=2; } //$sum-= strlen($inputs[$i]); } echo $sum;
based on Ua89f
Output for 7.0.0
Parse error: syntax error, unexpected ';', expecting ',' or ')' in /in/cgSgE on line 8
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected ';' in /in/cgSgE on line 8
Process exited with code 255.