No, that is incorrect… they will have a ID of 0 for guests… but does look like I gave you incorrect code… should be:
SP()->user->thisUser->ID
but I will have to research why the member user_id even exists for users… and why we use it in couple locations… should be consistent and stick with the right one..