3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $query = "{${phpinfo()}}"; $query = filter_string($query); function check_string($str) { return preg_match("/^\w+$/", (string)$str); } function filter_string($str) { return preg_replace('/^(.*)$/ie', "filter_function(\"\\1\")", $str); } function filter_function($str) { // do encoding / filtering etc. here return $str; } ?>
based on OclsK
Output for 7.0.0 - 7.1.0
Warning: phpinfo() has been disabled for security reasons in /in/UAG0j on line 2 Notice: Undefined variable: in /in/UAG0j on line 2 Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/UAG0j on line 9
Output for 5.5.0 - 5.6.28
Warning: phpinfo() has been disabled for security reasons in /in/UAG0j on line 2 Notice: Undefined variable: in /in/UAG0j on line 2 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/UAG0j on line 9
Output for 5.3.0 - 5.4.45
Warning: phpinfo() has been disabled for security reasons in /in/UAG0j on line 2 Notice: Undefined variable: in /in/UAG0j on line 2