3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
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.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected ';' in /in/cgSgE on line 8
Process exited with code 255.

preferences:
166.12 ms | 1395 KiB | 24 Q