不推荐使用PHP 7.2 create_function()

I have a function which I'm not entirely sure how to convert to get it working with PHP 7.2:

static function toCamelCaseFromUnderscore($str) {
    $func = create_function('$c', 'return strtoupper($c[1]);');
    return preg_replace_callback('/_([a-z])/', $func, $str);
}

Although I agree with the comments, the examples on PHP.net are more then clear, for sake of closing this

static function toCamelCaseFromUnderscore($str) {
    return preg_replace_callback('/_([a-z])/', function($c){
         return strtoupper($c[1]);
    }, $str);
}