If you're on Android, I think this still works. Try setting an alarm for 5 minutes from now and turn your phone off. It should turn back on for the alarm.
Edit: Just tried it and it worked on the native OnePlus clock app, but not on the Google clock.
My pixel 4a died because it got bend a little bit and the display was broken. This dead fucker made hardware alarm for like 2 weeks. Saddest wakeups ever.
You mean hardware alarm on the phone that works while the phone is off (meaning an alarm running on the RTC of the phone), or actual physical alarm clocks? Because the latter still exist.