__autoload( ) is called whenever you try to create an object of a class that hasn't been defined
<? function __autoload($Class) { print "Bar class name: $Class!\n"; include "barclass.php"; } $foo = new Bar; $foo->wombat( ); ?>