If I erase all settings + data on iPhone and set up as new iPhone?

I recently sold my iPhone, before erasing all data and settings I was logged into my iCloud, when I setup the iPhone again I just put in any E-mail and password for iCloud, is they any possible way they will be able to access my iCloud if they were to log out of that account? Probably a stupid question but just want to be 100% sure.

Not a chance, you should probably reset it again and sell it on the welcome page, Hope thos helps!