I wrote a bookmark manager in 2005-ish using security-conscious PHP, and it still works great.
I rewrote it in React for fun and not only is it totally out of date, but Github's dependabot has sent me probably 200+ security advisories based on its dependencies.
My handcrafted legacy.c64g.com site made in 2005 still works with php8.3 (I see I have to renew the cert). I just had to switch from mysql to mysqli.
However my Symfony sites had to be rewritten.
Friends don't let friends code using Symfony.
There was no upgrade path.
Deprecated components with no replacement.
I was so fed up with all the bullshit from 2010-2013 with the OO fetishism the "treat PHP like it's Java" from fresh students and graduates that I had to abandon it and switch to Go, which gave me peace of mind and a factor 100 performance boost.
In 10+ years of professional PHP development, the only time I've ever had to fix a codebase while updating the PHP version was when mcrypt was deprecated, and it was only around half an hour of work to replace it with a modern equivalent, including the time to re-encrypt the data.
Meanwhile, I've had the misfortune of inheriting a React application that would no longer build a mere six months after the original developer left the company. I've come to loath working on React projects due to the insane amount of library and tooling churn in that ecosystem.
That was in 2015, and it barely impacted anything I touched. So, granted, technically not quite 10+ years, but you get worse churn in JS frameworks over an 8 months period. (Unless it's jquery.)
For better or worse, you can take 10+ years old PHP code and it'll mostly just work.