php autoload
In general, when we use a file which not include in current file, we need to load it in current file by using require or include;
But when a project has a lot of php files, it is not a good way to include each file manually.
Let’s see a simple code:
<?php
$person = new Person("Rhys", 20);
var_dump($person);
There is a new class Person which didn’t be load in current file. In this case, php will call default autoload method spl_autoload() in order to load possible class;