The string is read byte by byte,
the pattern matches the two bytes of œ separately.
Array
(
[0] => �
[1] => �
)
The string is read code point by code point encoded in utf-8,
but since [:alnum:] is extended,
it contains œ, so there's no match.
Array
(
)
The string is read byte by byte,
and because [:alnum:] contains œ with (*UCP),
it fails at position 0 but succeeds on the second byte at position 1.
Array
(
[0] => Array
(
[0] => �
[1] => 1
)
)
The string is read code point by code point,
[:alnum:] doesn't contain œ,
the pattern matches at position 0 and return a code point.
Array
(
[0] => œ
)
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The string is read byte by byte,
the pattern matches the two bytes of œ separately.
Array
(
[0] => �
[1] => �
)
The string is read code point by code point encoded in utf-8,
but since [:alnum:] is extended,
it contains œ, so there's no match.
Array
(
)
The string is read byte by byte,
and because [:alnum:] contains œ with (*UCP),
it fails at position 0 but succeeds on the second byte at position 1.
Array
(
[0] => Array
(
[0] => �
[1] => 1
)
)
The string is read code point by code point,
[:alnum:] doesn't contain œ,
the pattern matches at position 0 and return a code point.
Array
(
[0] => œ
)