ID: 47740
Updated by: [email protected]
Reported By: jonathan dot aquino at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: HTTP related
Operating System: Unix
PHP Version: 5.2CVS-2009-03-21 (snap)
-Assigned To:
+Assigned To: mike
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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