3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.32, 8.2.0 - 8.2.28, 8.3.0 - 8.3.21, 8.4.1 - 8.4.7
Warning: Undefined array key "user" in /in/nes2n on line 8 Warning: Undefined array key "pass" in /in/nes2n on line 9 Warning: Undefined array key "user" in /in/nes2n on line 10 Warning: Undefined array key "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 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
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 7.3.32 - 7.3.33
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.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 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.0.5, 5.1.0 - 5.1.6, 5.2.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.3.11, 4.4.0 - 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

preferences:
184.73 ms | 416 KiB | 5 Q