3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = ['âa', 'Bbbbb', 'Éé', 'iou', 'Δδ']; $tests[] = 'ⅷ'; $tests[] = 'Ⅷ'; foreach ($tests as $test) { echo "\n{$test}:"; echo "\n\thasLetterVariants: " , preg_match('~^\p{L&}~u', $test) ? 'yes' : 'no'; echo "\n\tPREG (ext): " , preg_match('~^\p{Lu}~u', $test) ? 'upper' : 'not upper'; echo "\n\tPREG: " , preg_match('~^[\p{Lu}\x{2160}-\x{216F}]~u', $test) ? 'upper' : 'not upper'; echo "\n\tCTYPE: " , ctype_upper(mb_substr($test, 0, 1)) ? 'upper' : 'not upper'; echo "\n\t< a: " , mb_substr($test, 0, 1) < 'a' ? 'upper' : 'not upper'; $chr = mb_substr ($test, 0, 1, "UTF-8"); echo "\n\tMB: " , mb_strtoupper($chr, "UTF-8") == $chr ? 'upper' : 'not upper'; echo "\n\tIntlChar:" , IntlChar::isUUppercase(mb_substr($test, 0, 1)) ? 'upper' : 'not upper'; }
Output for git.master, git.master_jit, rfc.property-hooks
âa: hasLetterVariants: yes PREG (ext): not upper PREG: not upper CTYPE: not upper < a: not upper MB: not upper IntlChar:not upper Bbbbb: hasLetterVariants: yes PREG (ext): upper PREG: upper CTYPE: upper < a: upper MB: upper IntlChar:upper Éé: hasLetterVariants: yes PREG (ext): upper PREG: upper CTYPE: not upper < a: not upper MB: upper IntlChar:upper iou: hasLetterVariants: yes PREG (ext): not upper PREG: not upper CTYPE: not upper < a: not upper MB: not upper IntlChar:not upper Δδ: hasLetterVariants: yes PREG (ext): upper PREG: upper CTYPE: not upper < a: not upper MB: upper IntlChar:upper ⅷ: hasLetterVariants: no PREG (ext): not upper PREG: not upper CTYPE: not upper < a: not upper MB: not upper IntlChar:not upper Ⅷ: hasLetterVariants: no PREG (ext): not upper PREG: upper CTYPE: not upper < a: not upper MB: upper IntlChar:upper

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:
88.4 ms | 408 KiB | 5 Q