3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sanitizeUri($uri) { $keysToSanitize = array( 'password', 'provider_refresh_token', 'provider_consumer_secret' ); foreach ($keysToSanitize as $key) { $pattern = "/(?:\?|&)$key=(\S*?)(?:\s|&)?"; while (preg_match($pattern, $uri, $matches) && $matches[1] != "**hidden**") { $uri = str_replace($matches[1], "**hidden**", $uri); } } return $uri; } $uri1 = "POST /2.0/accounts/5520ccca39a0328d4d8b456a/sources?label=0&type=IMAP&use_ssl=1&passwOrd=pizza&email=kaisi789%40aol.com&server=imap.yahoo.com&port=993&username=kaisi789%40aol.com&passWord=nachos HTTP/1.0"; $uri2 = "POST /2.0/accounts/5520ccca39a0328d4d8b456a/sources?label=0&type=IMAP&use_ssl=1&provider_refresh_token=sidfosdifo2 HTTP/1.0"; $uri3 = "POST /2.0/accounts/5520ccca39a0328d4d8b456a/sources?provider_refresh_token=sidfosdifo2"; print_r(sanitizeUri($uri1) . "\n"); print_r(sanitizeUri($uri2) . "\n"); print_r(sanitizeUri($uri3) . "\n");
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 POST /2.0/accounts/5520ccca39a0328d4d8b456a/sources?label=0&type=IMAP&use_ssl=1&passwOrd=pizza&email=kaisi789%40aol.com&server=imap.yahoo.com&port=993&username=kaisi789%40aol.com&passWord=nachos HTTP/1.0 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 POST /2.0/accounts/5520ccca39a0328d4d8b456a/sources?label=0&type=IMAP&use_ssl=1&provider_refresh_token=sidfosdifo2 HTTP/1.0 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 Warning: preg_match(): No ending delimiter '/' found in /in/cEnYo on line 12 POST /2.0/accounts/5520ccca39a0328d4d8b456a/sources?provider_refresh_token=sidfosdifo2

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:
57.67 ms | 403 KiB | 8 Q