Qualcosa del genere fatto con le closures (richiede PHP 5.3+):

Codice PHP:
<?php
function my_multiplier($times 1) {
    return function(
$num) use ($times) {
        echo 
$num $times"\n";
    };
}

$a my_multiplier();
$a(5);
$b my_multiplier(3);
$b(5);