Originally Posted by
jscheuer1
I will for now defer to both you and Daniel's take in PHP. In javascript I prefer to create scopes and/or assign values, objects, functions, etc. to a single object or function that gives accessibility from the global scope without polluting it with more than one variable or other named entity. Sometimes I prefer using no access to anything other than via an instance that's created for one or more page element(s), accessing it via that element(s) when needed. But that approach can be too limiting even in javascript and doesn't appear to have any direct equivalent in PHP, which never assigns anything to a page element (window, document or a tag). At least not that I know of.