diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1034,6 +1034,9 @@ static function date($format = "", $stamp = null) # Internal: Convert expression or funcname or function literal to callable static function createfunc($code) { + if ($code instanceof Closure && (new ReflectionFunction($code))->getNumberOfRequiredParameters() == 1) + $code = function($dummy, $v) use ($code) {return $code($v);}; + if (is_string($code) && it::match('^[\w:]+$', $code) && is_callable($code)) $code .= '($v)'; |