This function is smart enough not to add the same loader twice. This seems to work for all of the different loader formats. Example:
<?php
class ALoader
{
static function load($class) { return true; }
}
function anotherLoader($class) {
return true;
}
$F = new ALoader;
spl_autoload_register(array('ALoader', 'load'));
spl_autoload_register(array('ALoader', 'load'));
spl_autoload_register(array($F, 'load'));
spl_autoload_register('anotherLoader');
spl_autoload_register('anotherLoader');
var_dump(spl_autoload_functions());
?>