3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://api.tivi8k.net/viettel/?cid=160&token=P6cf0Swsh62FKd773_q_Cg&e=1499794112'; $parse = parse_url($url); print_r($parse); function unparse_url($parsed_url) { $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : ''; $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : ''; $user = isset($parsed_url['user']) ? $parsed_url['user'] : ''; $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : ''; $pass = ($user || $pass) ? "$pass@" : ''; $path = isset($parsed_url['path']) ? $parsed_url['path'] : ''; $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : ''; $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; return "$scheme$user$pass$host$port$path$query$fragment"; } $c = 'go'; if (isset($parse['host']) && preg_match('/.*?\.tivi8k\.net/', $parse['host'])) { if (isset($parse['path']) && substr_count($parse['path'], '/') === 2) { $parse['path'] = '/ffff/'; parse_str($parse['query'], $params); if (isset($params['token']) && isset($params['e'])) { $a = array( 'id', 'cid', 'channel' ); foreach ($a as $b) { if(isset($params[$b])) { unset($params[$b]); $params[$c]='ddd'; echo $_GET['bb']; } } $params['token'] = 'hello'; $parse['query'] = http_build_query($params); } } } print_r(unparse_url($parse)); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [scheme] => http [host] => api.tivi8k.net [path] => /viettel/ [query] => cid=160&token=P6cf0Swsh62FKd773_q_Cg&e=1499794112 ) Warning: Undefined array key "bb" in /in/L4vkS on line 34 http://api.tivi8k.net/ffff/?token=hello&e=1499794112&go=ddd

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:
38.87 ms | 401 KiB | 8 Q