3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vBase = [ 'properName' => function($value) { return (bool)preg_match('/^([A-ZА-Я]{1}[A-Za-zА-Яа-я]+){1}([\-\s]{1}[A-ZА-Я]{1}[A-Za-zА-Яа-я]+)*$/', $value); }, ]; $tests = [ 'Коломиец-Московская', 'Петр Могила', 'Nikita', 'Philipp Gopkalo', 'test 12', '12test', 'test12', 'alex' ]; foreach ($tests as $test) { print_r( [ 'value' => $test, 'isValidFormat' => (integer)$vBase['properName']($test), ] ); }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [value] => Коломиец-Московская [isValidFormat] => 0 ) Array ( [value] => Петр Могила [isValidFormat] => 0 ) Array ( [value] => Nikita [isValidFormat] => 1 ) Array ( [value] => Philipp Gopkalo [isValidFormat] => 1 ) Array ( [value] => test 12 [isValidFormat] => 0 ) Array ( [value] => 12test [isValidFormat] => 0 ) Array ( [value] => test12 [isValidFormat] => 0 ) Array ( [value] => alex [isValidFormat] => 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:
44.73 ms | 402 KiB | 8 Q