Apple has confirmed it will provide security updates for iPhones for at least five years, less than the seven years guaranteed by Samsung and Google. This is the first time Apple has committed to a minimum length of software support for iPhones. A new UK regulation requires companies to provide security updates for internet-connected devices for at least five years. This applies to iPhones, and Apple has confirmed they'll support iPhone 15 with security updates for at least five years from its launch in September 2023.
While Samsung and Google currently offer a longer guarantee, Apple has historically provided security updates for iPhones for over five years. So, iPhone users can likely expect to receive security updates for just as long, if not longer, than Samsung and Google devices.