original_string: final protected function cache_query($sql, $result){
          if( isset($this->query_cache[$sql]) ){
              $this->query_cache[$sql] = $result;
          }elseif( count($this->query_cache) >= $this->cache_limit ){
              // Remove oldest cache
              array_shift($this->query_cache);
              // save query
              $this->query_cache[$sql] = $result;
          }
      }
code: final protected function cache_query($sql, $result){
          if( isset($this->query_cache[$sql]) ){
              $this->query_cache[$sql] = $result;
          }elseif( count($this->query_cache) >= $this->cache_limit ){
              // Remove oldest cache
              array_shift($this->query_cache);
              // save query
              $this->query_cache[$sql] = $result;
          }
      }
code_tokens: final protected function cache_query ( $ sql , $ result ) { if ( isset ( $ this -> query_cache [ $ sql ] ) ) { $ this -> query_cache [ $ sql ] = $ result ; } elseif ( count ( $ this -> query_cache ) >= $ this -> cache_limit ) { // Remove oldest cache array_shift ( $ this -> query_cache ) ; // save query $ this -> query_cache [ $ sql ] = $ result ; } }
docstring: Save query cache
  
  @param string $sql
  @param mixed $result
docstring_tokens: Save query cache