|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #17533 parse_url shouldn't work with
Submitted: 2002-05-30 17:53 UTC Modified: 2002-06-09 19:37 UTC
From: dd at selftrade dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.1 OS: RedHat 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 - 42 = ?
Subscribe to this entry?

 [2002-05-30 17:53 UTC] dd at selftrade dot com
If you submit a url like to parse_url, it will parse it without any error, although this kind of URL is incorrect.

Try this:







It will return:


The same kind of thing happens if url="qwerty", as it will return "qwerty" as the path.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-04 14:20 UTC]
Just a note:

"qwerty" on it's own still can be right (e.g. you have a subdomain and set up your box that is in your domain search path).

On the other hand:
php -r 'print_r(parse_url("http://www][.ww_-/...._..-.../"));'

    [scheme] => http
    [host] => www][.ww_-
    [path] => /...._..-.../

So it looks like parse_url() only splits the url into it's distinct parts (which obviously works).

If this is true, this needs to be documented. Anyone else comments?
 [2002-06-04 16:15 UTC]
After examinign the code:

parse_url is not meant to validate the URL, just to break it up into it's distinct parts if possible.

Reclassifying as documentation problem.
 [2002-06-09 19:37 UTC]
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at In case this was a documentation 
problem, the fix will show up soon at
In case this was a website problem, the change will show
up on the site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 08 12:03:36 2021 UTC