Use static callback instead of create_function

Primarily for performance reasons.