3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(preg_quote("http://grenade.dev/", "/")); var_dump(preg_replace("/(http:\/\/grenade\.dev\/)(?:uk)?/", "http://grenade.dev/eu", "http://grenade.dev/")); var_dump(preg_replace("/(http:\/\/grenade\.dev\/)(?:uk)?/", "http://grenade.dev/eu", "http://grenade.dev/uk")); var_dump(preg_replace("/(http:\/\/grenade\.dev\/)(?:uk)?/", "http://grenade.dev/eu", "http://grenade.dev/uk/some-page"));
based on BSabg
Output for 4.3.0 - 7.2.0
string(24) "http\:\/\/grenade\.dev\/" string(21) "http://grenade.dev/eu" string(21) "http://grenade.dev/eu" string(31) "http://grenade.dev/eu/some-page"