On Thu, Mar 15, 2012 at 14:31, Stuart Dallas <stuart@xxxxxxxx> wrote: > > The @ prefix is banned from all code I go anywhere near - it's evil! I've used the following 'V' function for a long time, primarily for accessing the superglobals but it works for any array. > > <?php > session_start(); > $_SESSION['first_name'] = $first_name = V($_SESSION, 'first_name'); > > function V($arr, $key, $def = null) { > return isset($arr[$key]) ? $arr[$key] : $def; > } > ?> For the most part, I agree with you, but for this particular example, it simply silences the notice for an undefined variable, should it not be set, at the time of the function call. In nearly any other case, though, I'm totally with you. -- </Daniel P. Brown> Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php