In what ways has PHP evolved in the past decade to address security concerns and improve database interaction capabilities?

PHP has evolved in the past decade by introducing features like the filter extension for input validation, password hashing functions for secure password storage, and prepared statements for preventing SQL injection attacks. These improvements have helped address security concerns and improve database interaction capabilities in PHP applications.

// Example of using prepared statements to prevent SQL injection
$pdo = new PDO('mysql:host=localhost;dbname=mydatabase', 'username', 'password');
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = :username');
$stmt->bindParam(':username', $username);
$stmt->execute();