get_method() may modify the object pointer passed to it if method forwarding is used. In this case we do not want to modify the passed zval, so make sure that we copy the object into a temporary first.