ZF-6992: negative integers in an array become 4294967295

Issue Type: Bug Created: 2009-06-11T15:56:33.000+0000 Last Updated: 2009-06-22T10:36:10.000+0000 Status: Resolved Fix version(s): Reporter: patrick (diepatrone) Assignee: Wade Arnold (wadearnold) Tags: - Zend_Amf

Related issues: Attachments: - 010-Incubator-Amf3-fix-negative-int64.patch


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.


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


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.