#47740 [Asn->Bgs]: http_build_cookie() always returns false
| From: | jani@php.net | Date: | Wed, 06 May 2009 20:57:07 +0000 |
| Subject: | #47740 [Asn->Bgs]: http_build_cookie() always returns false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136884@lists.php.net to get a copy of this message | ||
ID: 47740
Updated by: jani@php.net
Reported By: jonathan dot aquino at gmail dot com
-Status: Assigned
+Status: Bogus
Bug Type: HTTP related
Operating System: Unix
PHP Version: 5.2CVS-2009-03-21 (snap)
Assigned To: mike
New Comment:
PECL bugs are supposed to be reported elsewhere, not in PHP core bugs.
http://pecl.php.net/bugs/ is good place to begin with..
Previous Comments:
------------------------------------------------------------------------
[2009-03-21 04:31:35] kalle@php.net
The prototype for http_build_cookie() says that it accepts an array
only and the description below it says an array/object. The following:
C:\php\src\Release_TS>php -r "$c =
http_parse_cookie('RMID=2dab5fc9296749c2f28ec0b7; expires=Saturday,
20-Mar-2010 01:34:06 GMT; path=/;domain=.nytimes.com');
var_dump(http_build_cookie($c));"
gives:
Warning: http_build_cookie() expects parameter 1 to be array, object
given in Command line code on line 1
bool(false)
however casting it to an array before passing it to http_build_cookie,
like:
http_build_cookie((array) $c);
makes it work, assigned to Mike so he can clarrify its an error with
pecl/http or a documentation issue.
------------------------------------------------------------------------
[2009-03-21 04:14:27] jonathan dot aquino at gmail dot com
Description:
------------
http_build_cookie returns false. PHP 5.2.6.
Reproduce code:
---------------
$cookie = http_parse_cookie('RMID=2dab5fc9296749c2f28ec0b7;
expires=Saturday, 20-Mar-2010 01:34:06 GMT; path=/;
domain=.nytimes.com');
var_dump(http_build_cookie($cookie));
Expected result:
----------------
RMID=2dab5fc9296749c2f28ec0b7
Actual result:
--------------
FALSE
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47740&edit=1