3v4l.org

run code in 300+ PHP versions simultaneously
<?php function validate($pattern, $input) { $escaped = preg_quote($pattern); $regex = '/^'.str_replace('&','[0-9a-zA-Z]',$escaped).'$/'; return preg_match($regex, $input); } echo validate('&-&', 'asd')."\n"; // 0 echo validate('&&&-&&&', 'asd-123')."\n"; // 1 echo validate('&-&', 'a-1')."\n"; // 1 echo validate('&&&{}[]().+*\\^$', 'asd{}[]().+*\\^$')."\n"; // 1 ?>
Output for git.master_jit, git.master, rfc.property-hooks
0 1 1 1

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:
71.3 ms | 405 KiB | 5 Q