|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47288 Component parameter in parse_url does not work properly
Submitted: 2009-02-03 13:26 UTC Modified: 2009-07-25 10:52 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: hakan at e-bite dot se Assigned:
Status: Not a bug Package: URL related
PHP Version: 5.2.8 OS: XP and Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hakan at e-bite dot se
New email:
PHP Version: OS:


 [2009-02-03 13:26 UTC] hakan at e-bite dot se
Parse_url() function does not work properly with component parameter as manual:

The function works well without the parameter

PHP Version 5.2.8 on Win XP
PHP Version 5.2.0-8+etch13 on Linux

H?kan Askengren

Reproduce code:

//Without component parameter, Works OK
$urlInfo = parse_url($url );

//With component parameter
$urlInfo = parse_url($url, PHP_URL_PATH );

Expected result:
array(2) {
  string(4) "http"
  string(11) ""

array(2) {
  string(4) "http"
  string(11) ""

Actual result:
array(2) {
  string(4) "http"
  string(11) ""



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-03 13:31 UTC] hakan at e-bite dot se
PS PHP_URL_PATH is just an example. Expected result for scheme and host is not as stated. I also tried PHP_URL_SCHEME and  PHP_URL_HOST with slightly different results. 
 [2009-02-03 18:57 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The url does not have a trailing /, so there is no path...
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 11:01:30 2024 UTC