change is_object to ($value instanceOf \Closure)