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.
The slop machine can backport the fix to PHP 5, or make your code compatible with PHP 8.
The slop machine can backport the fix to PHP 5, or make your code compatible with PHP 8.