PHP's __autoload() function is Deprecated: Use spl_autoload_register() Instead. PHP's __autoload() function is Deprecated: Use spl_autoload_register() Instead.

Posted by smokris on 2008.04.20 @ 11:11

Filed under:

PHP logoPHP 5’s spl_autoload_register() function has been around since late 2005, yet documentation on it is still pretty sparse.

spl_autoload_register() does basically the same thing as __autoload(), but — instead of being a callback defined in the global namespace (reminds me of ON ERROR GOTO in BASIC) — it allows you to add your autoload handler onto the end of a chain of callbacks. Useful if you don’t want to clobber everyone else’s autoload code.

More info here.