Is it possible to dump parameter expression in PHP?
<p>For <strong>PHP testing scripts</strong> I need a function <code>report()</code> that will report results of some expressions, like:</p>

<pre><code>report(in_array(null, $array));
report(in_array(false, $array)); 
# etc...
</code></pre>

<p><strong>The output</strong> should look like: </p>

<pre><code>in_array(null, $array) =&gt; false
in_array(false, $array) =&gt; true
</code></pre>

<p>So I want to print the expression along with the result. Thus in the report function I need some means how to print the expression which was given by the caller:</p>

<pre><code>function report($expr)
{
    SOME_FUNCTION($expr) 
        # function I'm looking for!!
        # function which would write the string 'in_array(null, $array)' to output!
    echo " =&gt; ";
    echo $expr;
    echo "&lt;br&gt;";
}
</code></pre>

<p><strong>Is there any such function that would dump the expression as given by the caller?</strong>
I know this can't be "normal" function, this would need to be somehow bound to PHP internals. But if there are magic things like <code>debug_print_backtrace()</code>, <code>__FUNCTION__</code> or <code>__LINE__</code>, then I think there still can be some chance...</p>
