3v4l.org

run code in 300+ PHP versions simultaneously
<?php function url_parse($url){ $sflfdfldf=$url; if(strpos($url,"?")>-1){ $a=explode("?",$url,2); $url=$a[0]; $query=$a[1]; } if(strpos($url,"://")>-1){ $scheme=substr($url,0,strpos($url,"//")-1); $url=substr($url,strpos($url,"//")+2,strlen($url)); } if(strpos($url,"/")>-1){ $a=explode("/",$url,2); $url=$a[0]; $path="/".$a[1]; } if(strpos($url,":")>-1){ $a=explode(":",$url,2); $url=$a[0]; $port=$a[1]; } $host=$url; $url=null; foreach(array("url","scheme","host","port","path","query") as $var){ if(!empty($$var)){ $return[$var]=$$var; } } //return array("url"=>$sflfdfldf,"scheme"=>$scheme,"host"=>$host,"port"=>$port,"path"=>$path,"query"=>$query,"a"=>$url); return $return; } ?> <?php /* Compare two outputs */ //mine print_r(url_parse("http://w.login.yahoo.com?.src=ym&.intl=gb&.lang=zh-Hans-HK&.done=https://mail.yahoo.com")); //internal print_r(parse_url("http://w.login.yahoo.com?.src=ym&.intl=gb&.lang=zh-Hans-HK&.done=https://mail.yahoo.com"));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [scheme] => http [host] => w.login.yahoo.com [query] => .src=ym&.intl=gb&.lang=zh-Hans-HK&.done=https://mail.yahoo.com ) Array ( [scheme] => http [host] => w.login.yahoo.com [query] => .src=ym&.intl=gb&.lang=zh-Hans-HK&.done=https://mail.yahoo.com )

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