3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(parse_url('file://c:/path/to/dir')); var_dump(parse_url('file:///path/to/dir')); var_dump(parse_url('phar://c:/path/to/dir')); var_dump(parse_url('phar:///path/to/dir'));
based on BjmcS
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.23, 7.4.0 - 7.4.12, 8.0.0
array(3) { ["scheme"]=> string(4) "file" ["host"]=> string(1) "c" ["path"]=> string(12) "/path/to/dir" } array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(12) "/path/to/dir" } array(3) { ["scheme"]=> string(4) "phar" ["host"]=> string(1) "c" ["path"]=> string(12) "/path/to/dir" } bool(false)