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

# new — New instance

NEW creates a new object by instantiating a class and automatically calling all constructors along the lines of inheritance. Arguments may be passed to local variables as parameters on switch of context.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| class | var |  | Class variable name |
| var | var |  | Object variable name |
| var_params | var |  | Variable name for associated parameter name and value pairs |

### Children
- (none)

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

### Result
- binding: var; type: array; predicate: no-result-propagation

### Examples

```xml
<class var="Human">
	<property name="gender">male</property>
</class>

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

	<property name="firstname"/>
	<property name="lastname"/>

	<constructor>
		<set var="this.firstname">$firstname</set>
		<set var="this.lastname">$lastname</set>
	</constructor>

	<method name="getName">
		<set var="return">$this.firstname $this.lastname</set>
	</method>
</class>

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

<call func="obj.getName" var="name"/>
<output>$name is $obj.gender!</output>

<!-- Bill Gates is male! -->
```
