PHP Anonymous Function

$functions = [
  'function1' => function ($echo) {
        echo $echo;
   }
];

or

function do_echo($echo) {
    echo $echo;
}

$functions = [
  'function1' => 'do_echo'
];

for PHP >5.3, call function use:

 
$functions['function1']('Hello world!');

call_user_func($functions['function1'], 'Hello world!');

This is from stackoverflow post: https://stackoverflow.com/questions/1499862/can-you-store-a-function-in-a-php-array