I have used create_function in my application below.
$callbacks[$delimiter] = create_function(\'$matches\', \"return \'$delimiter\' . strtolower(\\$matches[1
You should be able to use an Anonymous Function (aka Closure) with a call to the parent scoped $delimiter variable, like so:
$delimiter
$callbacks[$delimiter] = function($matches) use ($delimiter) { return $delimiter . strtolower($matches[1]); };