Unless the magical code generation machine can update packages that are no longer being updated, this isn't really a problem that can be solved with magical code generation.
Backporting the fix is much lower effort in total. It's just a few dozen minor PHP releases that are affected, but millions of websites still running on older PHP versions.