ZF-6992: negative integers in an array become 4294967295


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.


Can you supply an example of the array that you are sending.

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).


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

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

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

Patch has been committed to the standard trunk and will be included in the next mini release.