3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'œ'; preg_match_all('/[^[:alnum:]]/', $str, $matches); echo "The string is read byte by byte, \nthe pattern matches the two bytes of œ separately.\n"; print_r($matches[0]); preg_match_all('/[^[:alnum:]]/u', $str, $matches); echo "\nThe string is read code point by code point encoded in utf-8,\nbut since [:alnum:] is extended,\nit contains œ, so there's no match.\n"; print_r($matches[0]); preg_match_all('/(*UCP)[^[:alnum:]]/', $str, $matches, PREG_OFFSET_CAPTURE); echo "\nThe string is read byte by byte,\nand because [:alnum:] contains œ with (*UCP),\nit fails at position 0 but succeeds on the second byte at position 1.\n"; print_r($matches[0]); preg_match_all('/(*UTF)[^[:alnum:]]/', $str, $matches); echo "\nThe string is read code point by code point,\n[:alnum:] doesn't contain œ,\nthe pattern matches at position 0 and return a code point.\n"; print_r($matches[0]);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
151.59 ms | 2164 KiB | 10 Q