I'm trying to use class autoloading in my project. This is what I wrote:
on main.php:
namespace myproject;
spl_autoload_extensions(".php");
spl_autoload_register();
subspace\myclass::mystaticmethod();
on subspace/myclass.php:
namespace myproject\subspace;
class myclass {
static function mystaticmethod() {
....
}
}
I get this error:
PHP Fatal error: Class 'myproject\\subspace\\myclass' not found
So far I've only found a problem with case sensitive names in the documentation, so I switched to lowercase only but I get the same error. Why?
[EDIT] Using PHP 5.3.3