UnsetArrayValue
API reference › yii › helpers › UnsetArrayValue
Object that represents the removal of array value while performing ArrayHelper::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
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__set_state() static | Restores class state after using var_export(). | UnsetArrayValue |
Method details
Section titled “Method details”__set_state()
Section titled “__set_state() ”public static function __set_state(array $state): yii\helpers\UnsetArrayValueRestores class state after using var_export().
Parameters
| Parameter | Type | Description |
|---|---|---|
$state | array |
Returns
Since
2.0.16
See also