3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'foobar: 2008'; if (preg_match('/(?P<name>\w+): (?P<digit>\d+)/', $str, $matches)) { print_r( array_filter($matches, function ($key) { return !is_int($key); }, ARRAY_FILTER_USE_KEY) ); }

preferences:
25.15 ms | 406 KiB | 5 Q