3v4l.org

run code in 500+ PHP versions simultaneously
<?php foreach(array( '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 = array(); if(isset($path['scheme'])) $ta = array_merge($ta, array($path['scheme'], ":")); if(isset($path['host'])) $ta[] = "//"; if(isset($path['user'])) $ta[] = $path['user']; if(isset($path['pass'])) $ta = array_merge($ta, array(":", $path['pass'])); if(isset($path['user'])) $ta[] = "@"; if(isset($path['host'])) $ta[] = $path['host']; if(isset($path['port'])) $ta = array_merge($ta, array(":", $path['port'])); if(isset($path['path'])) $ta[] = "[{$path['path']}]"; if(isset($path['query'])) $ta = array_merge($ta, array("?", $path['query'])); if(isset($path['fragment'])) $ta = array_merge($ta, array("#", $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.46 ms | 2425 KiB | 4 Q