3v4l.org

run code in 500+ PHP versions simultaneously
<?php $regex = '/(foo)?(bar)?(baz)?/'; $regex = preg_replace('~.[a-z\s]*$~i', '|(?<phpstanNamedCaptureGroupLast>)$0', $regex); var_dump(preg_match($regex, '', $matches, PREG_UNMATCHED_AS_NULL)); var_dump($matches); var_dump(preg_match($regex, '', $matches)); var_dump($matches);
Output for git.master, git.master_jit, rfc.property-hooks
int(1) array(6) { [0]=> string(0) "" [1]=> NULL [2]=> NULL [3]=> NULL ["phpstanNamedCaptureGroupLast"]=> NULL [4]=> NULL } int(1) array(1) { [0]=> string(0) "" }

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:
70.08 ms | 995 KiB | 4 Q