3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
string(143) "array(4) { 'controller' => string(5) "index" 'action' => string(5) "index" 'password' => string(5) "h@x0r" 'login' => string(10) "haxor@leet" }"