Cover multiple Twig function names with a wildcard function name

Code
<?php

$closure 
= function($asterisk$str) {
    return 
"<$asterisk>".md5($str)."</$asterisk>";
};

// twig function name has a * wildcard
$function = new Twig_SimpleFunction('md5_*'$closure,
    [
'is_safe' => ['html']]);

// Using md5_* function in template
$templates = [
    
'template' => '{{ md5_strong("string") }}
    <br>{{ md5_em("string") }}'
,
];
$loader = new Twig_Loader_Array($templates);
$twig = new Twig_Environment($loader);
$twig->addFunction($function);

echo 
$twig->render('template');
Result
b45cffe084dd3d20d928bee85e7b0f21
b45cffe084dd3d20d928bee85e7b0f21
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6