I think the lesson here is "don't be a commodity"?
In this light, PHP coders are real commodities. They are paid lowly, treated as expendable, and get no respect by peers. I think they're going down the same path of "HTML experts" which were once lucrative business in early 1990s.
Java/C++ programmers fare better because (I guess) there is some fundamental difficulty to be proficient at them. So, despite being old and boring, being good at Java or C(++) is still a good business.
Learning Go/Rust is another way to avoid being a commodity. Although they have a smaller job market, employers need to treat you with respect, because they can't easily find another worker with a matched skill in the market.