3v4l.org

run code in 300+ PHP versions simultaneously
<?php const URLS = [ "http://site.com/", "http://site.com/save", "http://site.com/save/results", "http://site.com/save/results/path", "http://site.com/path/save/results", "http://site.com/save/path", "http://site.com/path/results", "http://site.com/Crawler4", "http://site.com/Crawler", ]; $seen = []; $siteStructure = []; foreach (URLS as $url) { $domainUrl1 = parse_url($url, PHP_URL_SCHEME); $domainUrl2 = parse_url($url, PHP_URL_HOST); $domainPath = parse_url($url, PHP_URL_PATH); $paths = preg_split('/[^a-zA-Z0-9]+/', $domainPath, 0, PREG_SPLIT_NO_EMPTY); $domainUrl = $domainUrl1 . '://' . $domainUrl2; array_unshift($paths, $domainUrl); $paths = array_flip($paths); foreach ($paths as $key => $value){ if ($key != [0-9] && is_array($value) == false){ if ($value == 0){ $siteStructure[$key] = []; } elseif ($value >= 0 ){ $keybefore = $value - 1; $keys = array_keys($paths)[$keybefore]; $siteStructure[$keys] = [$key => $keybefore]; } } } } var_dump($siteStructure);
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { ["http://site.com"]=> array(1) { ["Crawler"]=> int(0) } ["save"]=> array(1) { ["path"]=> int(1) } ["results"]=> array(1) { ["path"]=> int(2) } ["path"]=> array(1) { ["results"]=> int(1) } }

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:
60.35 ms | 402 KiB | 8 Q