Check if var exist before unsetting in PHP?

php

Solution

Just unset it, if it doesn't exist, nothing will be done.

Problem

With error reporting on, or even for best practice, when unsetting a variable in PHP, should you check to see if it exist first (in this case it does not always exist) and the unset it, or just unset it? ``` <?PHP if (isset($_SESSION['signup_errors'])){ unset($_SESSION['signup_errors']); } // OR unset($_SESSION['signup_errors']); ?> ```

Original source