3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = [ 'Pérez-González', 'Domínguez-Díaz', 'Güemez-Martínez', 'Johnson-De Sosa', 'Pérez-De la Cruz', 'smith', 'Pérez De la Cruz-González', 'de Gal-O\'Connell', 'Johnson--Johnson' ]; foreach ($names as $name) { echo "$name is " . (!preg_match("~^\pL+(?:[- ']\pL+)*$~u", $name) ? 'in' : '') . "valid\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Pérez-González is valid Domínguez-Díaz is valid Güemez-Martínez is valid Johnson-De Sosa is valid Pérez-De la Cruz is valid smith is valid Pérez De la Cruz-González is valid de Gal-O'Connell is valid Johnson--Johnson is invalid

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:
118.04 ms | 406 KiB | 5 Q