3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Ala ma 2 koty, Adam ma 4 psy"; preg_match_all("/(?P<kto>[A-Z]\w+)\s\w+\s(?P<ile>\d+)/", $str, $matches); print $matches[0][0] . "\n"; print $matches[0][1] . "\n"; print $matches[1][0] . "\n"; print $matches[1][1] . "\n";

preferences:
36.4 ms | 402 KiB | 5 Q