Code: Select all
// A generic function to create and fetch static objects
function staticInstance($class)
{
// Declare a static variable to hold the object instance
static $instance;
// If the instance is not there, create one
if(!isset($instance)) {
$instance =& new $class;
}
return($instance);
}Just about the time I get things figured out, I find someone 3 levels above me and all the sudden I can't figure the code out even when it's commented.
Thanks in advance to all you true PHP gurus who constantly drag my skills ahead by taking time to answer my questions.
BTW, is the search feature on PHP.net broken. I get the number of matches found, but an empty list of results. Weird!