3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = array('Mike Cannon-Brookes', "Bill O'Hara-Jones", "Jane O'-Reilly", "Mary Smythe-'Fawkes"); foreach ($names as $name) { $name_valid = preg_match("/^(?!.*['-]{2})[a-zA-Z][a-zA-Z'\s-]{1,20}$/", $name); echo "$name is " . (($name_valid) ? "valid" : "not valid") . "\n"; }
Output for git.master_jit, git.master, rfc.property-hooks
Mike Cannon-Brookes is valid Bill O'Hara-Jones is valid Jane O'-Reilly is not valid Mary Smythe-'Fawkes is not valid

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