Scope and Namespacing

Scope

The scope is the realm or dimension in which your variables and objects exist. All the things in this dimension must have their own unique name. Function and methods can define any number of variables

Global Namespace

This is the highest scope level PHP has. It contains the $_GLOBAL var for the PHP instance.

Class-level

Function or Method-level

Namespacing

Namespacing is a technique used to avoid collisions with other objects or variables in the global namespace. They’re also extremely useful for helping organize blocks of functionality in your application into easily manageable groups that can be uniquely identified.