Issue Details (XML | Word | Printable)

Key: ZF-6992
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Wade Arnold
Reporter: patrick
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

negative integers in an array become 4294967295

Created: 11/Jun/09 03:56 PM   Updated: 22/Jun/09 10:36 AM   Resolved: 22/Jun/09 10:36 AM
Return to search "Fixed in 1.5.1"
Component/s: Zend_Amf
Affects Version/s: 1.8.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File 010-Incubator-Amf3-fix-negative-int64.patch (0.6 kB)



 Description  « Hide

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.



Wade Arnold added a comment - 11/Jun/09 04:07 PM

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


patrick added a comment - 11/Jun/09 04:24 PM

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


Stefan Klug added a comment - 12/Jun/09 03:22 AM

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


patrick added a comment - 12/Jun/09 04:04 AM

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


Stefan Klug added a comment - 18/Jun/09 07:04 AM

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


Wade Arnold added a comment - 22/Jun/09 10:36 AM

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