What are the implications of using deprecated functions in long-standing codebases and how should they be addressed?

Using deprecated functions in long-standing codebases can lead to compatibility issues with newer PHP versions and potential security vulnerabilities. To address this, deprecated functions should be replaced with their updated equivalents or alternative methods to ensure the codebase remains functional and secure.

// Before
$deprecatedResult = mysql_query($query);

// After
$mysqli = new mysqli($host, $username, $password, $database);
$result = $mysqli->query($query);