3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<EOD http://localhost:8000/search/fa?q=sth http://localhost:8000/search?q=sth http://localhost:8000/search http://localhost:8000/search/fa EOD; preg_match_all('/^(.*?)\/(\w{2,})(?:\?(.*?)|)$/mis',$str,$p); echo '<pre/>'; $final_array = array(); $i = 0; foreach($p[1] as $myP){ if( $p[2][$i] == 'fa'){ $p[2][$i] = 'en'; } else if($p[2][$i] != 'en') { $p[2][$i] = $p[2][$i].'/'.'en'; } $final_array[$i] = $myP.'/'.$p[2][$i]; $i++; } var_dump($final_array);
Output for git.master, git.master_jit, rfc.property-hooks
<pre/>array(4) { [0]=> string(31) "http://localhost:8000/search/en" [1]=> string(32) " http://localhost:8000/search/en" [2]=> string(32) " http://localhost:8000/search/en" [3]=> string(32) " http://localhost:8000/search/en" }

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