# UnsetArrayValue

> Object that represents the removal of array value while performing yii\helpers\ArrayHelper::merge().

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [helpers](/docs/api/yii/helpers/index.md) › UnsetArrayValue

| class | `yii\helpers\UnsetArrayValue` |
| --- | --- |
| Since | 2.0.10 |
| Source | [`framework/helpers/UnsetArrayValue.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/helpers/UnsetArrayValue.php#L51) |

Object that represents the removal of array value while performing [`ArrayHelper::merge()`](/docs/api/yii/helpers/basearrayhelper/index.md#method-merge).

Usage example:

```
$array1 = [
    'ids' => [
        1,
    ],
    'validDomains' => [
        'example.com',
        'www.example.com',
    ],
];

$array2 = [
    'ids' => [
        2,
    ],
    'validDomains' => new \yii\helpers\UnsetArrayValue(),
];

$result = \yii\helpers\ArrayHelper::merge($array1, $array2);
```

The result will be

```
[
    'ids' => [
        1,
        2,
    ],
]
```

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__set_state()`](#method-__set_state) static | Restores class state after using `var_export()`. | `UnsetArrayValue` |

## Method details

### __set_state() <span id="method-__set_state"></span>

```php
public static function __set_state(array $state): yii\helpers\UnsetArrayValue
```

Restores class state after using `var_export()`.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$state` | `array` |  |

**Returns**

[`UnsetArrayValue`](/docs/api/yii/helpers/unsetarrayvalue/index.md)

**Since**

2.0.16

**See also**

- <https://www.php.net/manual/en/function.var-export.php>