Zend Framework

Sparse array returned with mixed indexes(AMF3)

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.7.6
  • Fix Version/s: None
  • Component/s: Zend_Amf
  • Labels:
    None

Description

When i try return next array

array(1=> '1', 5 => '5');

as result it is returned to flash as:

array(0=> '1', 1 => '5');

Then when i want return some db data like array(id => value) - i cannot do it.

Activity

Hide
Ilya Gruzinov added a comment -

Proposed solution

Show
Ilya Gruzinov added a comment - Proposed solution
Hide
Ilya Gruzinov added a comment -

Next code from Zend_XmlRpc_Value::_phpVarToNativeXmlRpc() can bu used:

if (!empty($value) && is_array($value) && (array_keys($value) !== range(0, count($value) - 1))) {
...

Show
Ilya Gruzinov added a comment - Next code from Zend_XmlRpc_Value::_phpVarToNativeXmlRpc() can bu used: if (!empty($value) && is_array($value) && (array_keys($value) !== range(0, count($value) - 1))) { ...

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated: