run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'fix me <a href="www.link.com">link</a> or fix me <a href="link.com">link</a> and fix me too <a href="http://link.com">link</a> and replace me with <a href="http://www.link.com>link</a> <a href="http://www-is-for-world-wide-web.com">buggy!</a>'; echo str_replace('www.www', 'www', str_replace('http://www.http://', 'http://www.', str_replace('a href="', 'a href="http://www.', $str)));
Output for 4.3.0 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0RC3
fix me <a href="http://www.link.com">link</a> or fix me <a href="http://www.link.com">link</a> and fix me too <a href="http://www.link.com">link</a> and replace me with <a href="http://www.link.com>link</a> <a href="http://www-is-for-world-wide-web.com">buggy!</a>
Output for hhvm-3.10.0

Process exited with code 153.