3v4l.org

run code in 300+ PHP versions simultaneously
<?php preg_match_all( '#(?:\[link|(?!^)\G)\K(?:\s+([^=\s]+)=["\'](.*?)["\']|.*?\](.*?)\[/link\])#i', 'ops [link href="http://www.google.com"]www.google.com[/link]', $matches, PREG_SET_ORDER); var_dump($matches); exit; $links = array(); $reset = true; foreach($matches as $match) { if($reset) { $links[] = array( 'params' => array(), 'value' => null ); $reset = false; } end($links); $key = key($links); if(isset($match[3])) { $links[$key]['value'] = $match[3]; $reset = true; } else { $links[$key]['params'][$match[1]] = $match[2]; } } print_r($links);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> array(3) { [0]=> string(29) " href="http://www.google.com"" [1]=> string(4) "href" [2]=> string(21) "http://www.google.com" } [1]=> array(4) { [0]=> string(22) "]www.google.com[/link]" [1]=> string(0) "" [2]=> string(0) "" [3]=> string(14) "www.google.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:
28.71 ms | 402 KiB | 8 Q