3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = 'hostname.com/path?arg=value#anchor'; print_r(parse_url($url)); echo parse_url($url, PHP_URL_SCHEMA);
Output for 7.0.0 - 7.1.7
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Notice: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' in /in/6hn48 on line 7 Warning: parse_url() expects parameter 2 to be integer, string given in /in/6hn48 on line 7
Output for 5.1.2 - 5.6.28
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Notice: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' in /in/6hn48 on line 7 Warning: parse_url() expects parameter 2 to be long, string given in /in/6hn48 on line 7
Output for 4.3.0 - 5.1.1
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Notice: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' in /in/6hn48 on line 7 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/6hn48 on line 7