What are the benefits of adhering to the DRY (Don't Repeat Yourself) principle when refactoring PHP code for compatibility with older PHP versions?

Adhering to the DRY (Don't Repeat Yourself) principle when refactoring PHP code for compatibility with older PHP versions helps in reducing code duplication, improving maintainability, and making the code easier to understand. By following this principle, you can ensure that any changes or updates only need to be made in one place, rather than having to update multiple instances of the same code.

// Before refactoring
$var1 = 'value';
$var2 = 'value';
$var3 = 'value';

// After refactoring
$value = 'value';
$var1 = $value;
$var2 = $value;
$var3 = $value;