static public function bindClass($interface_or_class, $class, $init_function = null)
    {
        if (empty($class)) {
            throw new \Exception("Bound class is empty!");
        }
        
        if (empty($interface_or_class)) {
            throw new \Exception("Bound interface or class is empty!");
        }
        
        if (!interface_exists($interface_or_class) && !class_exists($interface_or_class)) {
            throw new \Exception(sprintf("The interface or class '%s' does not exist!", $interface_or_class));
        }
        
        if (!class_exists($class)) {
            throw new \Exception(sprintf("The class '%s' does not exist!", $class));
        }
        
        try {
            $ic = new \ReflectionClass($interface_or_class);
            $c = new \ReflectionClass($class);
        } catch (\Exception $ex) {
            throw new \Exception($ex->getMessage());
        }
        
        if (!$c->isInstantiable()) {
            throw new \Exception(sprintf("The class '%s' is not instantiable!", $c->getName()));
        }
        
        if ($c != $ic) {
            if (!$c->isSubclassOf($ic)) {
                throw new \Exception(sprintf("The class '%s' does not implement the interface '%s'!", $c->getName(), $ic->getName()));
            }
        }
        
        $f = null;
        if ($init_function !== null) {
            if (!is_callable($init_function)) {
                throw new \Exception(sprintf("'%s' is not a function!", $init_function));
            }
            
            try {
                $f = new \ReflectionFunction($init_function);
            } catch (\Exception $ex) {
                throw new \Exception($ex->getMessage());
            }
        }
        
        self::$itable[$ic->getName()] = ["class" => $c, "init_function" => $f];
    }