From: thomas dot werner at mac dot com
Operating system: Linux / MacOSX
PHP version: 4.4.1
PHP Bug Type: WDDX related
Bug description: Strange behavior of function "wddx_deserialize"
Description:
------------
I have a wddx file:
*******************
<wddxpacket version="1.0">
<header>
<comment>Content Configuration File</comment>
</header>
<data>
<struct>
<var name="content_queries">
<struct>
<var name="content_113300831086270200">
<struct>
<var name="113301888545229100">
<struct>
<var name="max">
<number>10</number>
</var>
<var name="cache">
<number>4</number>
</var>
<var name="order">
<struct>
<var
name="content_113300831086270200">
<struct>
<var name="CMS_BUILD">
<string>desc</string>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</data>
</wddxpacket>
and load it with the function "wddx_deserialize" in $config.
var_dump outputs different arrays in php-4.4.0 and
php-4.4.1.
["113301888545229100"] (4.4.0) and [2147483647] (4.4.1) are
not the same (string vs. int).
i used exact the same configuration for compiling and
checked it with debian sarge on linux and macosx too.
cheers tom
Reproduce code:
---------------
[...]
if ( !( $filepointer = @fopen( $filename, 'r' ) ) ) {
return false;
}
while ( !feof( $filepointer) ) {
$data .= fgets( $filepointer, 4096 );
}
fclose( $filepointer );
if ( $data ) {
$config = wddx_deserialize( $data );
[...]
Expected result:
----------------
[...]
["content_queries"]=>
array(1) {
["content_113300831086270200"]=>
array(1) {
["113301888545229100"]=>
array(3) {
["max"]=>
int(10)
["cache"]=>
int(4)
["order"]=>
array(1) {
["content_113300831086270200"]=>
array(1) {
["CMS_BUILD"]=>
string(4) "desc"
}
}
}
}
}
[...]
Actual result:
--------------
[...]
["content_queries"]=>
array(1) {
["content_113300831086270200"]=>
array(1) {
[2147483647]=>
[...]
2147483647 is not right...
--
Edit bug report at http://bugs.php.net/?id=35410&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35410&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35410&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35410&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35410&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35410&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35410&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35410&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35410&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35410&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35410&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35410&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35410&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35410&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35410&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35410&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35410&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35410&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35410&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35410&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35410&r=mysqlcfg