Zend Framework

negative integers in an array become 4294967295

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.8.2
  • Fix Version/s: None
  • Component/s: Zend_Amf
  • Labels:
    None

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.

Activity

Hide
Wade Arnold added a comment -

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

Show
Wade Arnold added a comment - Can you supply an example of the array that you are sending.
Hide
patrick added a comment -

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

Show
patrick added a comment - 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).
Hide
Stefan Klug added a comment -

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

Show
Stefan Klug added a comment - 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
Hide
patrick added a comment -

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

Show
patrick added a comment - 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
Hide
Stefan Klug added a comment -

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

Show
Stefan Klug added a comment - 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
Hide
Wade Arnold added a comment -

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

Show
Wade Arnold added a comment - Patch has been committed to the standard trunk and will be included in the next mini release.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: