Doc #53371 [NEW]: parse_url docs say it returns FALSE on malformed URLs. It may return NULL.
| From: | brianlmoon@php.net | Date: | Sun, 21 Nov 2010 16:28:02 +0000 |
| Subject: | Doc #53371 [NEW]: parse_url docs say it returns FALSE on malformed URLs. It may return NULL. | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-5566@lists.php.net to get a copy of this message | ||
From: brianlmoon
Operating system: All
PHP version: 5.3.3
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:parse_url docs say it returns FALSE on malformed URLs. It may return NULL.
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 bug report at http://bugs.php.net/bug.php?id=53371&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53371&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53371&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53371&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53371&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53371&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53371&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53371&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53371&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53371&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53371&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53371&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53371&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53371&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53371&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53371&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53371&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53371&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53371&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53371&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53371&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53371&r=mysqlcfg