public function serialize(SpanContext $context)
    {
        $ret = '00-' . $context->traceId();
        if ($context->spanId()) {
            $ret .= '-' . str_pad($context->spanId(), 16, "0", STR_PAD_LEFT);
        }
        if ($context->enabled() !== null) {
            $ret .= '-' . ($context->enabled() ? '01' : '00');
        }
        return $ret;
    }
public function serialize(SpanContext $context)
    {
        $ret = '00-' . $context->traceId();
        if ($context->spanId()) {
            $ret .= '-' . str_pad($context->spanId(), 16, "0", STR_PAD_LEFT);
        }
        if ($context->enabled() !== null) {
            $ret .= '-' . ($context->enabled() ? '01' : '00');
        }
        return $ret;
    }
public function serialize ( SpanContext $ context ) { $ ret = '00-' . $ context -> traceId ( ) ; if ( $ context -> spanId ( ) ) { $ ret .= '-' . str_pad ( $ context -> spanId ( ) , 16 , "0" , STR_PAD_LEFT ) ; } if ( $ context -> enabled ( ) !== null ) { $ ret .= '-' . ( $ context -> enabled ( ) ? '01' : '00' ) ; } return $ ret ; }
Convert a SpanContext to header string. Uses version 0.

@param SpanContext $context
@return string
Convert a SpanContext to header string . Uses version 0 .