3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = '7778855'; $mask = 'aabb'; $pattern = '/()?'; $arr = array(''); for($i=0;$i<strlen($mask);$i++) if(in_array($mask[$i] , $arr)) $pattern .= '\\'.array_search($mask[$i] , $arr); else {$pattern .= '([^\g{-1}])';$arr[] = $mask[$i];} $pattern .= '/'; var_dump($pattern); var_dump(preg_replace($pattern, '<$0>', $num));
Output for git.master, git.master_jit, rfc.property-hooks
string(31) "/()?([^\g{-1}])\1([^\g{-1}])\2/" Warning: preg_replace(): Compilation failed: range out of order in character class at offset 10 in /in/frSgc on line 11 NULL

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