<?php
    function customError($errorno, $errorstr) 
    {
        echo "Error: [$errorno] $errorstr";
        die();
    }
    //error handler
    set_error_handler("customError", E_USER_WARNING);
    //call undefined variable
    echo ($variable);
?>