static function smartUnserialize(string $data)
    {
        try {
            $value = @unserialize($data);
        } catch (\Throwable $e) {
            throw new DeserializationFailedException('An exception was thrown during unserialization', 0, $e);
        }

        // distinguish between "false on error" and a serialized FALSE value
        if ($value === false && $data !== self::getSerializedFalse()) {
            throw new DeserializationFailedException('Unserialization failed - data possibly malformed');
        }

        return $value;
    }