3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PMF_Filter { /** * Static wrapper method for filter_input() * * @param integer $type Filter type * @param string $variable_name Variable name * @param integer $filter Filter * @param mixed $default Default value * * @return mixed */ public static function filterInput ($type, $variable_name, $filter, $default = null) { $return = filter_input($type, $variable_name, $filter); return (is_null($return) || $return === false) ? $default : $return; } } $_GET["highlight"] = "foo"; $highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED); var_dump($highlight); if (!is_null($highlight) && $highlight != "/" && $highlight != "<" && $highlight != ">") { // && PMF_String::strlen($highlight) > 3 $highlight = str_replace("'", "ยด", $highlight); $highlight = str_replace(array('^', '.', '?', '*', '+', '{', '}', '(', ')', '[', ']'), '', $highlight); $highlight = preg_quote($highlight, '/'); $searchItems = explode(' ', $highlight); } var_dump($highlight); var_dump($searchItems);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Constant FILTER_SANITIZE_STRIPPED is deprecated in /in/TMB3U on line 23 NULL NULL Warning: Undefined variable $searchItems in /in/TMB3U on line 36 NULL

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.54 ms | 401 KiB | 8 Q