Wraps a PHP Closure to make it Serializable