3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sanipath( $path ) { global $patternsPath; global $styleguidePath; $saniPath = str_replace( "../", "", $path ); $saniPath = str_replace( ";", "", $saniPath ); $saniPath = htmlspecialchars( $saniPath ); $saniFile = preg_replace( "/\.[^$]*/", "", $saniPath); $ret = $saniFile . ".html"; return $ret; } var_dump(sanipath('/files/..././..././..././var/www/config.ini'));

preferences:
38.55 ms | 402 KiB | 5 Q