While I haven't had it that long, I was given a PowerBook G4 Titanium back in 2014 (it didn't power on, the PRAM battery was dead shorted) and looking at the bottom it's copyright Apple Computer Inc, 2000. That makes it now 20 years old and still working on most modern sites (through hacks). The battery that was in it also works (although it only lasts for an hour or hour and a half. the latter playing music the other just sitting with the screen on). My second oldest is an iPhone 4 I found discarded at a junkyard. It worked last time I tried putting a SIM into it, sadly it's on iOS 7 (which i despise) and cannot be downgraded. I found it in 2018. It's in bad shape but still works.
This experience is why I still own Apple products. I don't support e-waste or disposability so I buy Apple to ensure long lasting items. I know many have 'laughed' at posts of me saying it but I seeing as I baby all my stuff, and don't abuse it, I expect my 2019 MBP to last 20 years like my PowerBook. The PowerBook is at the disadvantage given its archaic OS, 20 year old NiMH battery pack, dying SuperDrive (it will destroy discs if you use it too much), and a spinning hard disk that's been clicking and freezing the system doing anything intensive for a few years now. My MBP has the upper hand with more RAM, me disabling updates, an SSD, and Li-Ion battery.
View attachment 956043