diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -650,7 +650,10 @@ function date($format = "", $stamp = null) */ function map($expression, $array) { - $func = create_function('$k,$v', "return $expression;"); + static $cache = array(); + + if (!($func = $cache[$expression])) + $func = $cache[$expression] = create_function('$k,$v', "return $expression;"); foreach ($array as $k => $v) $result[$k] = $func($k, $v); |