PHP doesn't have the range of scopes that C++ has. Generally speaking, you have global scope and function scope. An item at function scope may be declared static.