Created
February 27, 2026 11:08
-
-
Save graste/7ba623726609dda6fb451f39789fbacc to your computer and use it in GitHub Desktop.
differences for character class \w in php 8.3 and php 8.4 due to https://php.watch/versions/8.4/pcre2-regexp-syntax-changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $s = "ΟδόςÏ Í J J̈"; | |
| foreach (preg_split("//u",$s,-1,PREG_SPLIT_NO_EMPTY) as $c) { | |
| printf( | |
| "%s U+%04X => %s (\w=%s)\n", | |
| $c, | |
| \IntlChar::ord($c), | |
| preg_match("/^[\w\s\-,.\x{00C0}-\x{017F}]$/u",$c) ? "MATCH" : "NO", | |
| preg_match("/^\w$/u",$c) ? "Y" : "N" | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment