3v4l.org

run code in 300+ PHP versions simultaneously
<?php function addQuery($url,array $query) { $cache=parse_url($url,PHP_URL_QUERY); if(empty($cache)) return $url."?".http_build_query($query); else return $url."&".http_build_query($query); } $test=array("http://example.com/page/","http://example.com/page","http://example.com/?p=page"); print_r(array_map(function($v){ return addQuery($v,array("myquery"=>"string")); },$test));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => http://example.com/page/?myquery=string [1] => http://example.com/page?myquery=string [2] => http://example.com/?p=page&myquery=string )

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