What are the potential issues with migrating a PHP script from version 5 to version 7?

One potential issue when migrating a PHP script from version 5 to version 7 is the deprecation of some functions and changes in syntax. To solve this, you will need to update deprecated functions, ensure compatibility with the new syntax, and address any changes in behavior.

// For example, in PHP 5, the mysql extension is deprecated and removed in PHP 7. 
// You will need to update any mysql functions to mysqli or PDO.

// PHP 5 code using mysql extension
$conn = mysql_connect('localhost', 'username', 'password');
mysql_select_db('database', $conn);

// PHP 7 code using mysqli extension
$conn = mysqli_connect('localhost', 'username', 'password', 'database');