diff --git a/lib/Util/Helpers.php b/lib/Util/Helpers.php index f9ce39b06d..48fea28da8 100644 --- a/lib/Util/Helpers.php +++ b/lib/Util/Helpers.php @@ -134,14 +134,16 @@ class Helpers { if($capitalise_first_char) { $str[0] = strtoupper($str[0]); } - $func = create_function('$c', 'return strtoupper($c[1]);'); - return preg_replace_callback('/_([a-z])/', $func, $str); + return preg_replace_callback('/_([a-z])/', function ($c) { + return strtoupper($c[1]); + }, $str); } static function camelCaseToUnderscore($str) { $str[0] = strtolower($str[0]); - $func = create_function('$c', 'return "_" . strtolower($c[1]);'); - return preg_replace_callback('/([A-Z])/', $func, $str); + return preg_replace_callback('/([A-Z])/', function ($c) { + return "_" . strtolower($c[1]); + }, $str); } static function joinObject($object = array()) {