Most schools don't have lockers anymore.
But in most schools where there aren't really strong bans, what happens is of course you're not supposed to be texting and playing games during class, but the teachers at worst would ask you to put it down. They daren't actually take the phone for myriad reasons:
• Could start a physical altercation
• Parents are going to harangue the teacher about how they "need it" to stay in touch with their kids "for safety" or some long story about some supposed responsibility the kid needs to be reachable for
• Risk of liability (what if another kid steals it while it's in custody)
• End of the day one way or another it'll just be given back, so why waste your effort and risk all of the above for basically nothing.
I think the newer bans may be more about actual school administration support intended to assure teachers and other staff that there will be effective consequences of continual phone abuse, so that it's not pointless to try to enforce no-phone rules.