A potential PHP memory hog or not?
Hey, i'm in need of advice. Is this little function i wrote "good" or is it going to be a resource hog?
It's used in the following way:
    
    $login = load_class('LoginClass');

or 

    load_class('LoginClassTwo', false); // for singletons and stuff
    $loginTwo = LoginClassTwo::getInstance();
Here's the function 

    function load_class($class, $instantiate = TRUE){
	
	static $obj = array(); // holds the instancec of the classes
	
	$l = strtolower($class); // the name of the file is the name of the class but lowercased
	
	if (isSet($obj[$l])) { // Do we have an instance?
		
		return $obj[$l]; 
	}
	
	$file = 'classess/' . $l . '.class.php';
	if (file_exists($file) && is_readable($file)) { // Can we read the file?
		
		include $file;
		
		if ($instantiate == FALSE) { // Do we need to instantiate?
			
			$obj[$l] = TRUE;
		} else {
			
			$obj[$l] = new $class;
		}
		
		return $obj[$l];
	}
	
	return FALSE;  }

I'm concerned that this method is ineffective and it's going to consume too much memory or am i wrong? And is there a better practice for this?
A potential PHP memory hog or not?
===

Hey, i'm in need of advice. Is this little function i wrote "good" or is it going to be a resource hog?
It's used in the following way:
    
    $login = load_class('LoginClass');

or 

    load_class('LoginClassTwo', false); // for singletons and stuff
    $loginTwo = LoginClassTwo::getInstance();
Here's the function 

    function load_class($class, $instantiate = TRUE){
	
	static $obj = array(); // holds the instancec of the classes
	
	$l = strtolower($class); // the name of the file is the name of the class but lowercased
	
	if (isSet($obj[$l])) { // Do we have an instance?
		
		return $obj[$l]; 
	}
	
	$file = 'classess/' . $l . '.class.php';
	if (file_exists($file) && is_readable($file)) { // Can we read the file?
		
		include $file;
		
		if ($instantiate == FALSE) { // Do we need to instantiate?
			
			$obj[$l] = TRUE;
		} else {
			
			$obj[$l] = new $class;
		}
		
		return $obj[$l];
	}
	
	return FALSE;  }

I'm concerned that this method is ineffective and it's going to consume too much memory or am i wrong? And is there a better practice for this?