If you need to register the function when using namespaces, use the __NAMESPACE__ constant to define the name.
<?php
namespace Foobar;
spl_autoload_register('MyFunction'); // incorrect
spl_autoload_register('\MyFunction');// incorrect
spl_autoload_register(__NAMESPACE__ . '\MyFunction'); // correct
?>