<?php
$operations = array('+', '-', '*', '%');
$functions = array();
foreach ($operations as $op) {
    $functions[$op] = create_function('$a, $b', 'return $a ' . $op . ' $b;');
}
function mathOperation($a, $b, $operation) {
    global $functions;
    // return call_user_func($functions[$operation], $a, $b);
    return $functions[$operation]($a, $b);
}

header('Content-Type: text/plain');
foreach (array('+', '-', '*', '%') as $operation) {
    echo mathOperation(5, 3, $operation) . "\n";
}