PHP: Abstraction

When we look at abstract classes, we need to focus on the “abstract methods” within the abstract class. In fact, the rule #1 when dealing with abstraction is: if we create an abstract method in any class, we must make the entire class abstract. This clearly shows the importance of abstract classes comes from its…

PHP: SPL Autoload Register

PHP allows including files in a very easy way. This is very useful when dealing with multiple classes. The spl_autoload_register(function) registers a function with the Standard PHP Library (SPL) __autoload queue. If the queue is not yet activated it will be activated. The function is a user defined function as seen in the example below.…