2016-10-05 I'm currently working with code that heavily suffers from namespace pollution. As in most cases, it's the global namespace that is flooded (and in this case the session as well). This snippet is one of the flooders: foreach ($arr as $val) { if (isset($_REQUEST[$val])) { $GLOBALS[$val] = $_REQUEST[$val]; $_SESSION[$val] = $_REQUEST[$val]; } else { unset($GLOBALS[$val]); } } If we do want to have these as global variables (although it in- dicates other problems of the code), then we should at least bun- dle the set of variables in an array/hash: foreach ($arr as $val) { if (isset($_REQUEST[$val])) { $GLOBALS['request'][$val] = $_REQUEST[$val]; $_SESSION['request'][$val] = $_REQUEST[$val]; } else { unset($GLOBALS['request'][$val]); } } This way we don't flood the global namespace and still can access the data globally -- much better than the original code ... and often a first step in refactoring, because it helps to understand what's going on, in order to become able to remove the global data passing altogether. http://marmaro.de/lue/ markus schnalke