---
title: "instanceof — Instance of class"
description: "iXML command instanceof: Instance of class."
canonical_url: "https://www.zeyos.com/ixml/ref/instanceof"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/instanceof.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# instanceof — Instance of class

INSTANCEOF checks whether a variable is an object of a given class.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| class | var |  | Class variable name |
| var | var |  | Variable name |
| var_result | var |  | Result variable name |

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var_result; type: bool

### Examples

```xml
<class var="Human"/>

<class var="Person">
	<extends class="Human"/>

	<property name="name"/>

	<constructor>
		<set var="this.name">$name</set>
	</constructor>
</class>

<new class="Person" var="obj">
	<param name="name">Bill Gates</param>
</new>

<instanceof class="Human" var="obj" var_result="instanceof"/>

<is var="instanceof" type="true">
	<output>$obj.name is a human!</output>
</is>

<!-- Bill Gates is a human! -->
```

```xml
<class var="Person">
	<property name="name"/>

	<constructor>
		<set var="this.name">$name</set>
	</constructor>
</class>

<new class="Person" var="obj1">
	<param name="name">Bill Gates</param>
</new>

<new class="Person" var="obj2">
	<param name="name">Steve Jobs</param>
</new>

<instanceof class="obj1" var="obj2" var_result="instanceof"/>

<is var="instanceof" type="true">
	<output>$obj1.name is of the same class as $obj2.name!</output>
</is>

<!-- Bill Gates is of the same class as Steve Jobs! -->
```
