spl_autoload_register

PHP 5 >= 5.1.0, PHP 7, PHP 8
spl_autoload_register - Register given function as __autoload() implementation
Manual
Code Examples

Example #1 spl_autoload_register example where the class is not loaded

Result: [[Foobar\InexistentClass]] Fatal error: Class 'Foobar\InexistentClass' not found in ...
PHP Version:

Example #2 spl_autoload_register as a replacement for an __autoload function

PHP Version:


Function spl_autoload_register:

Standard PHP Library (SPL) Functions

Most used PHP functions