original_string: protected function sortByArray($array, $order)
      {
          $keys = array_keys($array);
          
          return array_merge(
              array_flip(
                  array_intersect($order, $keys) +
                  array_diff($keys, $order)
              ),
              $array
          );
      }
code: protected function sortByArray($array, $order)
      {
          $keys = array_keys($array);
          
          return array_merge(
              array_flip(
                  array_intersect($order, $keys) +
                  array_diff($keys, $order)
              ),
              $array
          );
      }
code_tokens: protected function sortByArray ( $ array , $ order ) { $ keys = array_keys ( $ array ) ; return array_merge ( array_flip ( array_intersect ( $ order , $ keys ) + array_diff ( $ keys , $ order ) ) , $ array ) ; }
docstring: Sort an array by its keys, using a given array as the sort order.
  
  @param  array  $array
  @param  array  $order
  @return array
docstring_tokens: Sort an array by its keys using a given array as the sort order .