3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function convert($url) { return preg_replace(':\/\/([^.]*\.)?mydomain\.tld', '://example.dev', $url); } var_dump(convert('http://haha.com/ferfe')); var_dump(convert('https://haha.com/ferfe')); var_dump(convert('http://foo.haha.com/ferfe')); var_dump(convert('https://foo.haha.com/ferfe'));
Output for 4.3.11 - 7.2.6
Warning: preg_replace(): No ending delimiter ':' found in /in/9ACf0 on line 4 NULL Warning: preg_replace(): No ending delimiter ':' found in /in/9ACf0 on line 4 NULL Warning: preg_replace(): No ending delimiter ':' found in /in/9ACf0 on line 4 NULL Warning: preg_replace(): No ending delimiter ':' found in /in/9ACf0 on line 4 NULL
Output for 4.3.0 - 4.3.10
Warning: No ending delimiter ':' found in /in/9ACf0 on line 4 NULL Warning: No ending delimiter ':' found in /in/9ACf0 on line 4 NULL Warning: No ending delimiter ':' found in /in/9ACf0 on line 4 NULL Warning: No ending delimiter ':' found in /in/9ACf0 on line 4 NULL