3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url1 = 'http://usr:pss@example.com:81/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment'; $url2 = '//usr:pss@example.com:81/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment'; $url3 = '//example.com/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment'; $url4 = '/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment'; $url5 = 'mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment'; echo PHP_EOL . ' = ' . var_export(PHP_VERSION, true); echo PHP_EOL . ' = ' . var_export($url1, true); echo PHP_EOL . ' = ' . var_export(parse_url($url1), true); echo PHP_EOL . ' = ' . var_export($url2, true); echo PHP_EOL . ' = ' . var_export(parse_url($url2), true); echo PHP_EOL . ' = ' . var_export($url3, true), 3, 'UTF-8'); echo PHP_EOL . ' = ' . var_export(parse_url($url3), true); echo PHP_EOL . ' = ' . var_export($url4, true), 3, 'UTF-8'); echo PHP_EOL . ' = ' . var_export(parse_url($url4), true); echo PHP_EOL . ' = ' . var_export($url5, true), 3, 'UTF-8'); echo PHP_EOL . ' = ' . var_export(parse_url($url5), true);
Output for 5.3.0 - 5.4.28
Parse error: syntax error, unexpected ')', expecting ',' or ';' in /in/Dv1cn on line 14
Process exited with code 255.