title: AWS SQS Delete Messages Using Receipt Handle
body: <p>I am trying to set up SQS and after receiving the message, I need to delete it from the queue.</p>
  
  <p>Creating Client - </p>
  
  <pre><code>$client = Aws\Sqs\SqsClient::factory(array(
                      'key'    =&gt; '******',
                      'secret' =&gt; '******',
                      'region' =&gt; 'ap-southeast-1'
              ));
  </code></pre>
  
  <p>Sending Message</p>
  
  <pre><code>public static function SendMessage()
      {
          if(!isset(self::$queueUrl))
              self::getQueueUrl();
  
          $command = "This is a command";
          $commandstring = json_encode($command);
  
          self::$client-&gt;sendMessage(array(
                  'QueueUrl'    =&gt; self::$queueUrl,
                  'MessageBody' =&gt; $commandstring,
          ));
      }
  </code></pre>
  
  <p>Receiving Message</p>
  
  <pre><code>public static function RecieveMessage()
      {
          if(!isset(self::$queueUrl))
              self::getQueueUrl();
  
          $result = self::$client-&gt;receiveMessage(array(
                  'QueueUrl' =&gt; self::$queueUrl,
          ));
  
  //      echo "Message Recieved &gt;&gt;  ";
          print_r($result);
          foreach ($result-&gt;getPath('Messages/*/Body') as $messageBody) {
              // Do something with the message
              echo $messageBody;
              //print_r(json_decode($messageBody));
          }
  
          foreach ($result-&gt;getPath('Messages/*/ReceiptHandle') as $ReceiptHandle) {
              self::$client-&gt;deleteMessage(self::$queueUrl, $ReceiptHandle);
          }
  
      }
  </code></pre>
  
  <p>When I try to delete the message using the Receipt Handle in the receive message code, I get error from Guzzle - 
  <strong>Catchable fatal error: Argument 2 passed to Guzzle\Service\Client::getCommand() must be an array, string given,</strong> </p>
  
  <p>Now after searching a lot for it, I was able to find similar questions which state that they were using wrong SDK version. I am still not able to narrow it down though. I am using the zip version of the latest sdk <a href="https://github.com/aws/aws-sdk-php/releases/tag/2.6.15" rel="nofollow">2.6.15</a></p>