3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "lorem ipsum <foo=42> dolor sit <bar=[17]> amet consectepture <foo=[37]> adipisicing elit <bar=19> sed do eiusmod"; $re = '/(?J)<%{name}=(?(?P<value>\\d+)|\\[(?P<value>\\d+)\\])>/'; foreach (array("foo", "bar") as $name) { echo $name, ": "; if (false !== preg_match(str_replace("%{name}", $name, $re), $string, $m)) { var_dump($m['value']); } else { echo "<FALSE>\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
foo: Warning: preg_match(): Compilation failed: assertion expected after (?( or (?(?C) at offset 11 in /in/In7Yu on line 8 <FALSE> bar: Warning: preg_match(): Compilation failed: assertion expected after (?( or (?(?C) at offset 11 in /in/In7Yu on line 8 <FALSE>

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