The spl_autoload_register() function can be used with 3 types of callbacks: functions, static methods and regular methods. Are there any advantages/disadvantages for these 3 types compared to each other?
The spl_autoload_register() function can be used with 3 types of callbacks: functions, static methods
Share
Not really any major differences.
A closure (defined like the following (PHP 5.3+ only)) can never be unregistered, unless it is saved to a variable:
A static method can actually auto load the static class before running its autoloader
Although, I dont know why you would want to do that.
Static calls are easier to unregister though.
Either way you should follow the PSR0 auto loading standards: https://gist.github.com/221634