library/Rediska/Serializer/Adapter/Json.php
public function serialize($value)
    {
        $options = 0;

        if ($this->_options['encodeasobject']) {
            $options = $options | JSON_FORCE_OBJECT;
        }
        if ($this->_options['encodehexquote']) {
            $options = $options | JSON_HEX_QUOT;
        }
        if ($this->_options['encodehextag']) {
            $options = $options | JSON_HEX_TAG;
        }
        if ($this->_options['encodehexamp']) {
            $options = $options | JSON_HEX_AMP;
        }
        if ($this->_options['encodehexapos']) {
            $options = $options | JSON_HEX_APOS;
        }

        $serializedValue = json_encode($value);

        if (json_last_error() != JSON_ERROR_NONE) {
            throw new Rediska_Serializer_Adapter_Exception("Can't serialize value");
        }

        return $serializedValue;
    }
public function serialize($value)
    {
        $options = 0;

        if ($this->_options['encodeasobject']) {
            $options = $options | JSON_FORCE_OBJECT;
        }
        if ($this->_options['encodehexquote']) {
            $options = $options | JSON_HEX_QUOT;
        }
        if ($this->_options['encodehextag']) {
            $options = $options | JSON_HEX_TAG;
        }
        if ($this->_options['encodehexamp']) {
            $options = $options | JSON_HEX_AMP;
        }
        if ($this->_options['encodehexapos']) {
            $options = $options | JSON_HEX_APOS;
        }

        $serializedValue = json_encode($value);

        if (json_last_error() != JSON_ERROR_NONE) {
            throw new Rediska_Serializer_Adapter_Exception("Can't serialize value");
        }

        return $serializedValue;
    }
Serialize value

@param mixed $value
@return string