3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $uri = 'https://www.algo.com/algo/algomas'; $parsed_uri = parse_url($uri); $rebuilt_host_part = ($parsed_uri['user'] ? $parsed_uri['user'] : '') . ($parsed_uri['pass'] ? ':'.$parsed_uri['pass'] : '') . ($parsed_uri['user'] ? '@' : '') . $parsed_uri['host'] . ($parsed_uri['port'] ? ':'.$parsed_uri['port'] : ''); $random = '_='.random_string('alnum', 3); $parsed_uri['fragment'] .= $parsed_uri['fragment'] ? '&'.$random : $random; $rebuilt_uri = sprintf('%s://%s%s%s', $parsed_uri['scheme'], $rebuilt_host_part, $parsed_uri['path'], $parsed_uri['query'] ? '?'.$parsed_uri['query'] : '', $parsed_uri['fragment'] ? '#'.$parsed_uri['fragment'] : ''); $uri = $rebuilt_uri; echo $uri;
Output for 7.0.0 - 7.2.6
Notice: Undefined index: user in /in/nes2n on line 8 Notice: Undefined index: pass in /in/nes2n on line 9 Notice: Undefined index: user in /in/nes2n on line 10 Notice: Undefined index: port in /in/nes2n on line 12 Fatal error: Uncaught Error: Call to undefined function random_string() in /in/nes2n:14 Stack trace: #0 {main} thrown in /in/nes2n on line 14
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Notice: Undefined index: user in /in/nes2n on line 8 Notice: Undefined index: pass in /in/nes2n on line 9 Notice: Undefined index: user in /in/nes2n on line 10 Notice: Undefined index: port in /in/nes2n on line 12 Fatal error: Call to undefined function random_string() in /in/nes2n on line 14
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Notice: Undefined index: user in /in/nes2n on line 8 Notice: Undefined index: pass in /in/nes2n on line 9 Notice: Undefined index: user in /in/nes2n on line 10 Notice: Undefined index: port in /in/nes2n on line 12 Fatal error: Call to undefined function random_string() in /in/nes2n on line 14
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Undefined index: user in /in/nes2n on line 8 Notice: Undefined index: pass in /in/nes2n on line 9 Notice: Undefined index: user in /in/nes2n on line 10 Notice: Undefined index: port in /in/nes2n on line 12 Fatal error: Call to undefined function: random_string() in /in/nes2n on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Undefined index: user in /in/nes2n on line 8 Notice: Undefined index: pass in /in/nes2n on line 9 Notice: Undefined index: user in /in/nes2n on line 10 Notice: Undefined index: port in /in/nes2n on line 12 Fatal error: Call to undefined function: random_string() in /in/nes2n on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined index: user in /in/nes2n on line 8 Notice: Undefined index: pass in /in/nes2n on line 9 Notice: Undefined index: user in /in/nes2n on line 10 Notice: Undefined index: port in /in/nes2n on line 12 Fatal error: Call to undefined function: random_string() in /in/nes2n on line 14