3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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";
based on VHEQ0
Output for 4.3.0 - 7.2.0
Ala ma 2 Adam ma 4 Ala Adam