original_string: protected function unref($data) {
          if ($this->definition->uses_simple_data()) {
              return $data;
          }
          // Check if it requires serialisation in order to produce a reference free copy.
          if ($this->requires_serialisation($data)) {
              // Damn, its going to have to be serialise.
              $data = serialize($data);
              // We unserialise immediately so that we don't have to do it every time on get.
              $data = unserialize($data);
          } else if (!is_scalar($data)) {
              // Its safe to clone, lets do it, its going to beat the pants of serialisation.
              $data = $this->deep_clone($data);
          }
          return $data;
      }
code: protected function unref($data) {
          if ($this->definition->uses_simple_data()) {
              return $data;
          }
          // Check if it requires serialisation in order to produce a reference free copy.
          if ($this->requires_serialisation($data)) {
              // Damn, its going to have to be serialise.
              $data = serialize($data);
              // We unserialise immediately so that we don't have to do it every time on get.
              $data = unserialize($data);
          } else if (!is_scalar($data)) {
              // Its safe to clone, lets do it, its going to beat the pants of serialisation.
              $data = $this->deep_clone($data);
          }
          return $data;
      }
code_tokens: protected function unref ( $ data ) { if ( $ this -> definition -> uses_simple_data ( ) ) { return $ data ; } // Check if it requires serialisation in order to produce a reference free copy. if ( $ this -> requires_serialisation ( $ data ) ) { // Damn, its going to have to be serialise. $ data = serialize ( $ data ) ; // We unserialise immediately so that we don't have to do it every time on get. $ data = unserialize ( $ data ) ; } else if ( ! is_scalar ( $ data ) ) { // Its safe to clone, lets do it, its going to beat the pants of serialisation. $ data = $ this -> deep_clone ( $ data ) ; } return $ data ; }
docstring: Removes references where required.
  
  @param stdClass|array $data
  @return mixed What ever was put in but without any references.
docstring_tokens: Removes references where required .