|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-07-08 06:55 UTC] remi@php.net
Description:
------------
boolean always deserialized as "true"
PHP 5 is ok
Detected as zend-zerializer test suite is failing.
Test script:
---------------
foreach([true, false, NULL] as $v) {
$x = wddx_serialize_value($v);
var_dump(wddx_deserialize($x));
}
Expected result:
----------------
bool(true)
bool(false)
NULL
Actual result:
--------------
bool(true)
bool(true)
NULL
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 02:00:01 2025 UTC |
I will commit patch + test later today: diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 13e48ff..c1121a7 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -1009,9 +1009,9 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len) case ST_BOOLEAN: if (!strcmp((char *)s, "true")) { - Z_LVAL(ent->data) = 1; + ZVAL_TRUE(&ent->data); } else if (!strcmp((char *)s, "false")) { - Z_LVAL(ent->data) = 0; + ZVAL_FALSE(&ent->data); } else { zval_ptr_dtor(&ent->data); if (ent->varname) {