Why this matters
Deprecated functions may be removed in future PHP releases and often lack security updates. Using up‐to‐date functions ensures compatibility, features, and security fixes, improving code longevity.
Avoid functions or extensions deprecated in recent PHP versions (e.g., mysql_* or preg_replace without proper delimiters). Use modern supported alternatives like PDO/MySQLi for DB or PCRE functions (preg_match, preg_replace with correct syntax).
Deprecated functions may be removed in future PHP releases and often lack security updates. Using up‐to‐date functions ensures compatibility, features, and security fixes, improving code longevity.
Side-by-side examples engineers can pattern-match during review.
<?php
// deprecated mysql_
$link = mysql_connect('localhost','user','pass');
?><?php
// use PDO instead of mysql_
$pdo = new PDO('mysql:host=localhost;dbname=test','user','pass');
?><?php
// deprecated mysql_
$link = mysql_connect('localhost','user','pass');
?><?php
// use PDO instead of mysql_
$pdo = new PDO('mysql:host=localhost;dbname=test','user','pass');
?>From the same buckets as this rule.
Before persisting ePHI, encrypt using a data key protected by a Key Management Service (KMS). Use authenticated encryption (AES-256-GCM or equivalent), rotate keys, and store the key id and algorithm with the record.