How do I make a function reference in PHP?
<p>I'm trying to make an associative array with values that are references to functions.  What is the proper way to do this?  This code works, but gives me a warning.</p>

<h3>Code</h3>

<pre><code>&lt;?php

$mergeCodes = array(
    'rev:(\d+)' =&gt; reverse_me,
);

$test = "This is a [[rev:1234]] test";

echo "BEFORE: $test\n";
foreach ($mergeCodes as $code =&gt; $callback) {
    $code = '\[\[' . $code . '\]\]';
    $test = preg_replace_callback( "/$code/", $callback, $test );
}
echo "AFTER: $test\n";

function reverse_me($input) {
    return strrev($input[1]);
}

?&gt;
</code></pre>

<h3>Output</h3>

<pre>
PHP Notice:  Use of undefined constant reverse_me - assumed 'reverse_me' in /tmp/test2.php on line 4
BEFORE: This is a [[rev:1234]] test
AFTER: This is a 4321 test
</pre>
