ZF-6992: negative integers in an array become 4294967295
Description
I want to use ZendAmf for sending Arrays from a .swf to php. The arrays contain integers (which can be positive and negative). If the integer is negative, php receives a number which apparently is 4294967295 minus the negative value. AmfPhp had the same problem, thats why i wanted to switch to ZendAmf.
Comments
Posted by Wade Arnold (wadearnold) on 2009-06-11T16:07:15.000+0000
Can you supply an example of the array that you are sending.
Posted by patrick (diepatrone) on 2009-06-11T16:24:57.000+0000
I just tried it again with the array: [-10, 10, -1000, 1000]; Php receives: 4294967286,10,4294966296,1000 I think this just happens online, locally it works (i am not sure at the moment).
Posted by Stefan Klug (stefanklug) on 2009-06-12T03:22:35.000+0000
Hi,
I can confirm this issue. It happens to all integers, if php is running on a 64 bit system. (The sign bit was extended with the assumption that an int has 32 bits)
I attached a patch to fix this.
Regards Stefan
Posted by patrick (diepatrone) on 2009-06-12T04:04:26.000+0000
Hi, with the patch ist works correctly! As i am very new to this stuff, just to make sure that i understood how the patch was meant: I changed the line beginning with - to the line beginning with + It seems to be correct. Thank you very much! Patrick
Posted by Stefan Klug (stefanklug) on 2009-06-18T07:04:46.000+0000
Yes thats how a patch works. Have a look at the command line tools 'patch' and 'diff'. 'man patch' will give you more infos.
Cheers Stefan
Posted by Wade Arnold (wadearnold) on 2009-06-22T10:36:10.000+0000
Patch has been committed to the standard trunk and will be included in the next mini release.