3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filterVarExportOneliner($text) { $replacement = '***'; return preg_replace( '/(\["password"\]=> string\([0-9]+\) )"([^"]+)"/', '\\1"***"', $text ); } $dump = <<<HTXT array(4) { 'controller' => string(5) "index" 'action' => string(5) "index" 'password' => string(5) "h@x0r" 'login' => string(10) "haxor@leet" } HTXT; var_dump(filterVarExportOneliner($dump));

preferences:
46.79 ms | 402 KiB | 5 Q