Variable dans OPHP

<?php

$host = "localhost";
$user = "root";
$pass = "";
$dbname = "cadastropessoa";

try{
    $conn = new PDO("mysql:host=$host;dbname=$dbname",$user,$pass);
    //echo "conexão feita com sucesso";
}catch(PDOException $e){
    echo "Connection failed:" . $e->getMessage();
}
Powerful Peafowl