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;
    }
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;
    }
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 ; }
Serializes a value.

@param mixed $value The value to serialize.

@return string The serialized value.

@throws SerializationFailedException If the value cannot be serialized.
Serializes a value .