What are common pitfalls to be aware of when transitioning code to run on PHP 7?

One common pitfall when transitioning code to run on PHP 7 is the use of deprecated functions or features that are no longer supported. To address this, it is important to review the PHP 7 migration guide and update any deprecated code to use the recommended alternatives.

// Deprecated code using mysql extension
$connection = mysql_connect('localhost', 'username', 'password');

// Updated code using mysqli extension
$connection = mysqli_connect('localhost', 'username', 'password');