Autoloading Rules in OOP in PHP
The spl_autoload_register function is written
only once at the beginning of the file. Then you can
create as many objects of different classes as you like,
the main thing is that their names follow
the conventions.
The spl_autoload_register function is written
only at the beginning of the file that is called
via the browser's address bar. That is,
if some class calls inside itself
another class or inherits from someone, and
the class itself is called in another file, then spl_autoload_register
needs to be written only in this other file
- it is not necessary to duplicate this function in the class file itself.