3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $address = "555 Test Drive, Testville, CA 98773"; preg_match("/(.+), (\w+), (\w+) (\w+)/", $address, $matches); print_r($matches); list($original, $street, $city, $state, $zip) = $matches; echo $street . "\n" . $city . "\n" . $state . "\n" . $zip;
based on KhP7s
Output for 4.3.0 - 5.6.30, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.3.1
Array ( [0] => 555 Test Drive, Testville, CA 98773 [1] => 555 Test Drive [2] => Testville [3] => CA [4] => 98773 ) 555 Test Drive Testville CA 98773