--- Zend/Amf/Parse/Amf3/Serializer.orig.php 2010-06-03 09:34:49.000000000 -0500 +++ Zend/Amf/Parse/Amf3/Serializer.php 2010-06-03 09:36:46.000000000 -0500 @@ -224,33 +224,33 @@ /** * Send string to output stream * * @param string $string * @return Zend_Amf_Parse_Amf3_Serializer */ public function writeString(&$string) { $len = strlen($string); if(!$len){ $this->writeInteger(0x01); return $this; } - $ref = array_search($string, $this->_referenceStrings, true); - if($ref === false){ - $this->_referenceStrings[] = $string; + $ref = array_key_exists($string, $this->_referenceStrings) ? $this->_referenceStrings[$string] : false; + if ($ref === false){ + $this->_referenceStrings[$string] = count($this->_referenceStrings); $this->writeBinaryString($string); } else { $ref <<= 1; $this->writeInteger($ref); } return $this; } /** * Send ByteArray to output stream * * @param string|Zend_Amf_Value_ByteArray $data * @return Zend_Amf_Parse_Amf3_Serializer */