use locate_template()
instead.
public function load_class( $class )
{
$path = str_replace('_', "https://wordpress.stackexchange.com/", $class);
// returns a path when something was found
$located = locate_template( $path, TRUE );
return $located ? TRUE : FALSE;
}
Always return FALSE
in an autoloader if you haven’t found the class.