original_string: public function toArray($protect = null)
      {
          $protect = is_array($protect)
              ? $protect
              : $this->_protect;
  
          if ($protect) {
              $new = $this->_params;
  
  
              foreach ($protect as $key) {
                  unset($new[$key]);
              }
  
              // Do json encode and decode to convert all levels to arrays
              return json_decode(json_encode($new), true, 512);
          }
  
          // Do json encode and decode to convert all levels to arrays
          return json_decode(json_encode($this->_params), true, 512);
      }
code: public function toArray($protect = null)
      {
          $protect = is_array($protect)
              ? $protect
              : $this->_protect;
  
          if ($protect) {
              $new = $this->_params;
  
  
              foreach ($protect as $key) {
                  unset($new[$key]);
              }
  
              // Do json encode and decode to convert all levels to arrays
              return json_decode(json_encode($new), true, 512);
          }
  
          // Do json encode and decode to convert all levels to arrays
          return json_decode(json_encode($this->_params), true, 512);
      }
code_tokens: public function toArray ( $ protect = null ) { $ protect = is_array ( $ protect ) ? $ protect : $ this -> _protect ; if ( $ protect ) { $ new = $ this -> _params ; foreach ( $ protect as $ key ) { unset ( $ new [ $ key ] ) ; } // Do json encode and decode to convert all levels to arrays return json_decode ( json_encode ( $ new ) , true , 512 ) ; } // Do json encode and decode to convert all levels to arrays return json_decode ( json_encode ( $ this -> _params ) , true , 512 ) ; }
docstring: Return the params as array and remove the protected keys
  
  @param array|null $protect
  
  @return array
docstring_tokens: Return the params as array and remove the protected keys