What does the anonymous function give me? : <p>I have in tutorial:</p>

<pre><code>public function execute(BaseRequest $request)
{
    $operation = function() use($request) {
        return $this-&gt;service-&gt;execute($request);
    };

    return $this-&gt;session-&gt;executeAtomically(
        $operation-&gt;bindTo($this)
    );
}
</code></pre>

<p>What does the anonymous function give me?</p>

<p>Why can't I just do:</p>

<pre><code>public function execute(BaseRequest $request)
{
    $operation = $this-&gt;service-&gt;execute($request);

    return $this-&gt;session-&gt;executeAtomically(
        $operation-&gt;bindTo($this)
    );
}
</code></pre>

<p>?</p>
