PHP a function in a functions argument?
<p>Is it possible to call a function as a function argument?
I'm trying to get the value of the bar function and pass it to the foo function.</p>

<p>If I try to set the function to a variable</p>

<p>e.g.</p>

<pre><code>$foobar = bar($x)
</code></pre>

<p>it will execute the function where ever the variable is found.</p>

<p>e.g.</p>

<pre><code>function bar($x) {
    $x = 1;
    return 1;
}
function foo(x) {
    $x += $x;
    echo $x;
}

foo(bar($x));
</code></pre>
