3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $address = "Flat 2 House Name 21 Another Road"; echo preg_match('/(Flat\s\d+) (\w+)(\s\d+)/i', $address) . PHP_EOL; $address = preg_replace('/(Flat\s\d+) (\w+)(\s\d+)/i', '\\1, \\2, \\3', $address); echo $address;
based on do4Qt
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
0 Flat 2 House Name 21 Another Road
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Z6s6W on line 5 0PHP_EOLFlat 2 House Name 21 Another Road