3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://eoc.io' if (!preg_match('~^https?\:\/\/(?:[a-z\_\-0-9]|\.)+\.[a-z0-9]+(\/?)~i', $url, $matched)) { }else if($matched && $matched[1] === ''){ $url .= '/'; } var_dump($url);
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'if' (T_IF) in /in/tLQ9I on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_IF in /in/tLQ9I on line 4
Process exited with code 255.

preferences:
200.67 ms | 1400 KiB | 67 Q