src/Zipkin/Tracer.php
public function openScope(?Span $span = null): callable
    {
        return $this->currentTraceContext->createScopeAndRetrieveItsCloser(
            $span === null ? null : $span->getContext()
        );
    }
public function openScope(?Span $span = null): callable
    {
        return $this->currentTraceContext->createScopeAndRetrieveItsCloser(
            $span === null ? null : $span->getContext()
        );
    }
Makes the given span the "current span" and returns the closer that exits that scope.
The span provided will be returned by {@link #currentSpan()} until the return value is closed.

<p>Note: While downstream code might affect the span, calling this method, and calling the closer on
the result have no effect on the input. For example, calling closer on the result does not
finish the span. Not only is it safe to call the closer, you must call the closer to end the scope, or
risk leaking resources associated with the scope.

@param Span $span to place into scope or null to clear the scope

@return callable The scope closer