title: Unsupported operand types from concatenation in PHP codeigniter
body: <p>So I have this error, "Unsupported operand types", coming from a concatenation in a PHP code. Below is the specific line where the error occurs:</p>
  
  <pre><code>  'full_name'  =&gt; ($recipient['firstname'].' '.$recipient['lastname'])
  </code></pre>
  
  <p>The snippet is from an array container shown as below:</p>
  
  <pre><code>  $summary = array(
     'full_name'  =&gt; ($recipient['firstname'].' '.$recipient['lastname'])
   );
  </code></pre>
  
  <p>There's nothing wrong with my code but it still produces this error. It was working before and then when I tried to test it again without changing anything, the error appeared.</p>
  
  <p>I am currently using, Codeigniter for the framework.</p>
  
  <p><strong>[UPDATED] Below is the function's code until where the error occured:</strong></p>
  
  <p>public function index_post() {
          // set max execution time and time limit to prevent time out because of the 3rd party integrations
          ini_set('max_execution_time', 300);
          set_time_limit ( 300 );</p>
  
  <pre><code>    // get JSON value post request
      $inputJSON      = file_get_contents( 'php://input' );
      $input_post     = json_decode( $inputJSON, TRUE ); //convert JSON into array
  
      // verify points if it still enough
      $is_points_enough = $this-&gt;verify_member_current_pondo_points($input_post['total_points_to_use']);
  
      // check if member has enough status. if not, return the error code
      if ( !$is_points_enough['status'] ) {
          $this-&gt;response( array(
              'status'   =&gt; TRUE,
              'response' =&gt; $is_points_enough,
          ), REST_Controller::HTTP_OK );
      }
  
      // construct data to pass to order verification
      $order_data['items']                            = $input_post['purchase_items']; // items to be redeemed
      $order_data['item_redeem_info']     = $input_post['item_redeem_info']; // information of the redeemer
      $order_data['member_info']              = array( // member account id and email from verifying token
          'account' =&gt; $this-&gt;user-&gt;account_id,
          'email'   =&gt; $this-&gt;user-&gt;email
      ); 
  
      // check if stocks are enough to continue the process
      $order = $this-&gt;order_transaction-&gt;checkout_order( $order_data ); 
  
      // if order process failed, it will return an error with its specific error message
      if (!$order['status']) {
          $this-&gt;response( array(
              'status'   =&gt; TRUE,
              'response' =&gt; $order,
          ), REST_Controller::HTTP_OK );
      }
      else {
          $items = $order; // these are the list of items already checked
  
          $recipient = $order_data['item_redeem_info']; // information of the redeemer
          $recipient_address = $order_data['item_redeem_info']['address']; // address of the redeemer
  
          $delivery_data['recipients'] = array();
          $recipient_data = array(
              'recipient' =&gt; array( // recipient's information
        'firstname'    =&gt; $recipient['firstname'],
        'lastname'     =&gt; $recipient['lastname'],
        'middlename'   =&gt; "",
        'contact'      =&gt; $recipient['contact'],
        'email'        =&gt; $recipient['email'],
        'notification' =&gt; 1, // value 1 means notification on
        'address'      =&gt; array(
          'country'     =&gt; "PH",
          'destination' =&gt; $recipient_address['destination'],
          'province'    =&gt; $recipient_address['province'],
          'city'        =&gt; $recipient_address['city'],
          'barangay'    =&gt; $recipient_address['barangay'],
          'street'      =&gt; $recipient_address['street'],
                      'landmarks'   =&gt; $recipient_address['landmarks']
                  )
              )
          );
          array_push($delivery_data['recipients'], $recipient_data);
  
          // if order has physical items included
          if (count($items['physical_item'][0]) &gt; 0) {
  
              $address = array( //address of recipient
        'province' =&gt; $recipient_address['province'],
        'city'     =&gt; $recipient_address['city'],
        'barangay' =&gt; $recipient_address['barangay'],
        'street'   =&gt; $recipient_address['street']
              );
  
              // if type is delivery, insert address data
              if ( ($recipient['type'] == "delivery") ) { 
                  $address = $this-&gt;order_transaction-&gt;add_address( $address );
              } else {
                  $address = $this-&gt;order_transaction-&gt;get_branch_address_id( $recipient['branch'] );
              }
  
              $_items = $items['physical_item']; //physical items list from the order result
              $_recipients = $delivery_data['recipients'][0]['recipient'];
              $packages['packages'] = array();
              $items_for_summary = array();
              $total_item_quantity = 0;
              $item_details = array();
  
              // set delivery details - package; also set the item summary to be delivered
              for ( $x = 0; $x &lt; count( $_items ); $x++ ) {
                  $result = $this-&gt;order_transaction-&gt;get_product_data_by_id( $_items[ $x ]['purchase_id'] ); //get product data to populate important details
                  array_push( $item_details, $result );
  
                  $_package = array(
                      'package' =&gt; array(
                          'pouch'       =&gt; 'UL',
                          'description' =&gt; $result-&gt;name,
                          'weight'      =&gt; 0,
                          'width'       =&gt; 0,
                          'height'      =&gt; 0,
                          'length'      =&gt; 0,
                          'value'       =&gt; 0,
                          'coupon'      =&gt; 0,
                          'sfc'         =&gt; 0,
                          'reference'   =&gt; "",
                          'notes'       =&gt; ""
                      )
                  );
                  //this container is for the delivery information
                  array_push( $packages['packages'], $_package ); 
  
                  //needed for product shipment information
                  $total_item_quantity = $total_item_quantity + $_items[ $x ]['quantity']; 
              }
  
              $delivery_data['recipients'][0]['recipient']['packages'] = $packages['packages'];
  
              //verify pondo account points if it is enough
              $is_points_enough = $this-&gt;verify_member_current_pondo_points( $input_post['total_points_to_use'] );
  
              // if points is not enough
              if ( !$is_points_enough['status'] ) { 
                  $data['status'] = $is_points_enough;
                  $data['error'] = array(
                      'code'    =&gt; $this-&gt;error_code['E_NOT_ENOUGH_POINTS'],
                      'message' =&gt; "Not enough points."
                  );
                  $this-&gt;response( array(
                      'status'   =&gt; TRUE,
                      'response' =&gt; $data,
                  ), REST_Controller::HTTP_OK );
              }
              // if points if enough
              else {
                  // points to redeem in pondo
                  $redeem_data['points'] = $input_post['total_points_to_use']; 
                  // description of redeem info for pondo
                  $redeem_data['description'] = "Mineski Infinity item/airtime redeem"; 
                  // redeem pondo points
                  $is_redeem = $this-&gt;redeem_current_pondo_points( $redeem_data ); 
  
                  // if it failed to redeem points
                  if ( !$is_redeem ) {
                      $data['status'] = FALSE;
                      $data['error'] = array(
                          'code'    =&gt; $this-&gt;error_code['E_CANNOT_REDEEM'],
                          'message' =&gt; "Cannot redeem points."
                      );
                      $this-&gt;response( array(
                          'status'   =&gt; TRUE,
                          'response' =&gt; $data,
                      ), REST_Controller::HTTP_BAD_REQUEST );
                  } 
                  // if it successfully to redeem points
                  else {
                      $delivery_data['schedule'] = $this-&gt;_get_delivery_date(); //delivery date
                      //send delivery information to xend
                      $booking_info = $this-&gt;order_transaction-&gt;ship_items( $delivery_data ); 
  
                      $booking_info = json_decode( $booking_info );
                      $tracking_code = $booking_info-&gt;tracking;
  
                      // $this-&gt;order_transaction-&gt;empty_cart( $this-&gt;user-&gt;id ); //empty cart
  
                      echo gettype($recipient['firstname']);
                      echo gettype($recipient['lastname']);
  
                      //set data for product shipment information
                      $summary = array( 
            'full_name'             =&gt; ($recipient['firstname'].' '.$recipient['lastname']),
            // 'contact'               =&gt; $recipient['contact'],
            // 'email'                 =&gt; $recipient['email'],
            // 'address_id'            =&gt; $address-&gt;id,
            // 'branch_id'             =&gt; ($recipient-['type'] == "pickup") ? $recipient['branch'] : '',
            // 'shipment_type'         =&gt; $recipient['type'],
            // 'total_item_quantity'   =&gt; $total_item_quantity,
            // 'member_id'             =&gt; $this-&gt;user-&gt;id,
            // 'date_ordered'          =&gt; date( "Y-m-d h:i:s" ),
            // 'tracking_code'         =&gt; $tracking_code[0],
            // 'date_received'         =&gt; 0,
            // 'delivery_status'       =&gt; 'pending',
            // 'date_expected_arrival' =&gt; 0,
            // 'remarks'               =&gt; (($recipient['remarks'] == NULL) || ($recipient['remarks'] == "")) ? "" : $recipient['remarks']
                      );
  
                      print_r($summary);
  </code></pre>