How can server migration affect PHP scripts and their functionality?

Server migration can affect PHP scripts and their functionality if the new server has different configurations or settings than the previous one. To ensure that PHP scripts work correctly after migration, it is important to check for any compatibility issues and make necessary adjustments to the code.

// Example of checking PHP version compatibility
if (version_compare(PHP_VERSION, '7.0.0') < 0) {
    die('PHP version 7.0.0 or higher is required');
}