Global vs function vs static class method
Let's say you have a object that is unique, and it's used by all other classes and functions ...something like $application . How would you access this object in your functions? using a global variable in each of you functions: global $application; $application->doStuff(); creating a function, like application() that instantiates the object into a static variable and returns it; then use this function everywhere you need to access the object: application()->doStuff(); create a singleton thing, like a static method inside the object class which returns the only instance, and use this method to