|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64846 Documentation says parse_url doesn't work with relative urls but it does
Submitted: 2013-05-15 18:42 UTC Modified: 2017-05-29 14:05 UTC
From: alias dot mac at gmail dot com Assigned: peehaa (profile)
Status: Closed Package: *URL Functions
PHP Version: 5.3.25 OS:
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: alias dot mac at gmail dot com
New email:
PHP Version: OS:


 [2013-05-15 18:42 UTC] alias dot mac at gmail dot com
From manual page:

It has on the notes:
"This function doesn't work with relative URLs."

But with my test script looks like it is working just fine:

$ php --version
PHP 5.3.20 (cli) (built: Jan 21 2013 15:03:13)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

Test script:

$x = '';


$y = 'path/to/somewhere?param1=x&param2=';



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-24 10:29 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: peehaa
 [2013-07-24 10:29 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

 [2017-05-28 19:27 UTC]
The note is still there.
 [2017-05-28 20:25 UTC]
-Status: Closed +Status: Re-Opened -Package: Documentation problem +Package: *URL Functions
 [2017-05-29 13:22 UTC]
-Assigned To: peehaa +Assigned To:
 [2017-05-29 13:22 UTC]
I did make the change in 2013

But people started shouting at me that it was *not* officially supported and my change was wrong. Hence I reverted.

So ¯\_(ツ)_/¯, if somebody else wants to make this change and/or close this bug report feel free to go for it :-)
 [2017-05-29 14:05 UTC]
-Status: Re-Opened +Status: Closed -Assigned To: +Assigned To: peehaa
 [2017-05-29 14:05 UTC]
Sounds like there was a good reason, then. So in practice relative URLs tend to work but some forms will be able to fool the parser.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 20:03:40 2023 UTC