mysqli_connect_error() not working to show errror

<?php 
echo "Welcome to the stage where we are ready to get connected to a database <br>";

// connecting to the Database
$servername = "localhost";
$username = "root";
$password = "hh";

// create a connection
$conn = mysqli_connect($servername, $username, $password);

// die if connection is unsuccessful
if (!$conn) {
    die("Sorry we failed to connect: ". mysqli_connect_error());;
} else {
    echo "Connection was successful";
}
?>

so in this code when i enter the wrong password (it is suppose to be empty) it is suppose to show the “Sorry we failed to connect: ” and then followed by the error.
but instead i get the fatal error message insteadenter image description here