3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function escape_string($s) { $r = ''; for($i=0;@$s[$i];$i++) { if($s[$i]!='\'') if($s[$i]!='"') if($s[$i]!='\\') if($s[$i]!="\n") if($s[$i]!="\r") if($s[$i]!="\x1a") { $r .= $s[$i]; continue; } $r .= '?'; } return $r; } $password = 'password0x270x270x270x27'; $password = escape_string($password); $query = "select 1 from auth where password='$password'"; echo($query); ?>
based on eNf27
Output for 5.5.0 - 7.3.0beta1
select 1 from auth where password='password'