I understand (and to note, you're already contributing to the PHP 5.2 discussion).
How about a very small wrapper for
?
Not tested it yet.
Also, shawn: do you have a sketch of how you think an ideal plugin would end up looking once the refactoring is done (like in a GitHub issue or comment or something)?
How about a very small wrapper for
create_function
:PHP Code:
// Wrapper
if (!class_exists('Closure') && !function_exists('closure')) {
function closure($params = '', $use = array(), $body = '') {
return create_function($params, "extract($use); " . $body);
}
}
// Example Usage
$i18n = closure('$hash', array('id' => $id), '
return i18n_r($id . "$hash");
');
?
Not tested it yet.
Also, shawn: do you have a sketch of how you think an ideal plugin would end up looking once the refactoring is done (like in a GitHub issue or comment or something)?