iPhones don’t shut off when you do that, but 5 rapid presses of the power button return it to the encrypted lock state, and require full password to unlock, exactly like full rebooting does. This is enabled by default iirc.
It also quickly vibrates a unique short pattern to let you know it worked so you can do it without looking at it.
If you want to fully shut it down, you can either long press the power and volume up, then drag the power off slider, or do the 5 press thing above and drag the slider.
The anecdote in question: