3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Parse an address spec string into an array * * @param $address * @return array * @throws \LogicException */ function parseAddress($address) { if ((!($parts = parse_url($address)) && !($parts = parse_url(preg_replace('#^([^:]+:/)//#', '$1', $address)))) || !isset($parts['scheme']) ) { throw new LogicException('Invalid address spec: ' . $address); } $parts['scheme'] = strtolower($parts['scheme']); return $parts; } var_dump(parseAddress('unix:///foo/bar.sock'));
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["scheme"]=> string(4) "unix" ["path"]=> string(13) "/foo/bar.sock" }

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