3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php parseSMTPParams($config) { if ( ! preg_match('/^(([\w\+%]+):([\w\+%]*)@)?([\w\.]+)(:\d+)?$/', $config, $matches) ) { /* Invalid format */ return null; } return $matches; } var_dump(parseSMTPParams("127.0.0.1")); var_dump(parseSMTPParams("192.168:34.56:2525")); var_dump(parseSMTPParams("myuser:mypass@mail.example.net")); var_dump(parseSMTPParams("foo%40bar.net:abc%3Adef@mail.example.net")); var_dump(parseSMTPParams("badescaping@test.net:abcdef@mail.example.net"));
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.34
Parse error: syntax error, unexpected '{' in /in/Dv6M5 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '{' in /in/Dv6M5 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Dv6M5 on line 2
Process exited with code 255.