original_string: public static function serialize($value)
      {
          if (is_resource($value)) {
              throw SerializationFailedException::forValue($value);
          }
  
          try {
              $serialized = serialize($value);
          } catch (Exception $e) {
              throw SerializationFailedException::forValue($value, $e->getMessage(), $e->getCode(), $e);
          }
  
          return $serialized;
      }
code: public static function serialize($value)
      {
          if (is_resource($value)) {
              throw SerializationFailedException::forValue($value);
          }
  
          try {
              $serialized = serialize($value);
          } catch (Exception $e) {
              throw SerializationFailedException::forValue($value, $e->getMessage(), $e->getCode(), $e);
          }
  
          return $serialized;
      }
code_tokens: public static function serialize ( $ value ) { if ( is_resource ( $ value ) ) { throw SerializationFailedException :: forValue ( $ value ) ; } try { $ serialized = serialize ( $ value ) ; } catch ( Exception $ e ) { throw SerializationFailedException :: forValue ( $ value , $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } return $ serialized ; }
docstring: Serializes a value.
  
  @param mixed $value The value to serialize.
  
  @return string The serialized value.
  
  @throws SerializationFailedException If the value cannot be serialized.
docstring_tokens: Serializes a value .