3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allIntlCharConstants = (new ReflectionClass('IntlChar'))->getConstants(); $constants = array_filter($allIntlCharConstants, function($name){ return strpos($name, 'CHAR_CATEGORY_') === 0; }, ARRAY_FILTER_USE_KEY); var_dump($constants); IntlChar::enumCharTypes(function($start, $end, $type) use ($constants) { printf("U+%04x through U+%04x are in category %d\n", $start, $end, array_search(type, $constants)); });

preferences:
43.26 ms | 402 KiB | 5 Q