Doc #53371 [Opn->Asn]: parse_url docs say it returns FALSE on malformed URLs. It may return NULL.

From: Date: Tue, 23 Nov 2010 11:29:36 +0000
Subject: Doc #53371 [Opn->Asn]: parse_url docs say it returns FALSE on malformed URLs. It may return NULL.
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5575@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53371&edit=1 ID: 53371 Updated by: aharvey@php.net Reported by: brianlmoon@php.net Summary: parse_url docs say it returns FALSE on malformed URLs. It may return NULL. -Status: Open +Status: Assigned Type: Documentation Problem Package: Documentation problem Operating System: All PHP Version: 5.3.3 -Assigned To: +Assigned To: aharvey Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2010-11-21 17:28:02] brianlmoon@php.net Description: ------------ From the docs: "On seriously malformed URLs, parse_url() may return FALSE. Otherwise an associative array is returned, whose components may be (at least one):" However, in some cases it will return NULL as well. Actually, I am having a really hard time getting it to return FALSE. I am not sure it ever does. I know it will throw a warning at times. But, it does not even seem to do that on an empty string. Test script: --------------- <?php var_dump(parse_url("1,2,3,4", PHP_URL_QUERY)); var_dump(parse_url("1,2,3,4")); ?> Expected result: ---------------- The documentation should state that the function returns NULL when the 2nd parameter is used and the requested portion of the URL is not not set. Actual result: -------------- The documentation makes no mention of the function ever returning NULL. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53371&edit=1

« previous php.doc.bugs (#5575) next »