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++){ for($j = 0; $j<addslashes($inputs[$i]); $j++){ if(addslashes($inputs[$i])[$j]==='\\'){ if(addslashes($inputs[$i])[$j+1]==='\"'){ $sum+=2; continue; } else{ $sum+=4; continue 3; } } else{ $sum++; } } $sum-= count($inputs[$i]); } echo $sum;
based on 1LtHC
Output for 7.0.0
Fatal error: Cannot 'continue' 3 levels in /in/LRSSd on line 15
Process exited with code 255.
Output for 5.4.10 - 5.6.28
-1
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/LRSSd on line 8
Process exited with code 255.