using Php;

namespace PhpNative {
    public bool class_exists (string class_name, bool autoload = false) {
        return GLib.Type.from_name (class_name) != 0;
    }

    public bool class_exists_static (string class_name, bool autoload, string php_file, int php_line) throws Error {
        return class_exists (class_name, autoload);
    }

    public zval class_exists_zval (zval class_name, zval autoload, string php_file, int php_line) throws Error {
        return zval.boolean (class_exists_static (zval_to_string (class_name), truthy (autoload), php_file, php_line));
    }
}
