3v4l.org

run code in 500+ PHP versions simultaneously
<?php foreach([ 'scheme://user@host/path', 'scheme://host/path', '/path', 'path', '//host/path', 'x:/path', 'scheme:///path', 'file:///path', 'file:/path', 'file:path', ] as $url) { print "\n: $url\n"; if($url === '--') continue; $path = parse_url($url); if($path === false) { print '"Seriously malformed URL." (q) https://php.net/parse_url' . "\n"; continue; } $ta = []; if(isset($path['scheme'])) $ta = array_merge($ta, [$path['scheme'], ":"]); if(isset($path['host']))// || (isset($path['scheme']) && isset($path['path']))) $ta[] = "//"; if(isset($path['user'])) $ta[] = $path['user']; if(isset($path['pass'])) $ta = array_merge($ta, [":", $path['pass']]); if(isset($path['user'])) $ta[] = "@"; if(isset($path['host'])) $ta[] = $path['host']; if(isset($path['port'])) $ta = array_merge($ta, [":", $path['port']]); if(isset($path['path'])) $ta[] = $path['path']; if(isset($path['query'])) $ta = array_merge($ta, ["?", $path['query']]); if(isset($path['fragment'])) $ta = array_merge($ta, ["#", $path['fragment']]); print implode(" ", $ta) . "\n"; }
Output for rfc.property-hooks, git.master, git.master_jit
: scheme://user@host/path scheme : // user @ host /path : scheme://host/path scheme : // host /path : /path /path : path path : //host/path // host /path : x:/path x : /path : scheme:///path "Seriously malformed URL." (q) https://php.net/parse_url : file:///path file : /path : file:/path file : /path : file:path file : path

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:
48.51 ms | 2395 KiB | 4 Q