State::__unset()

Deletes a state via property access.

Table of Contents
  1. Description
  2. Example

Description

State::__unset(string $key): void;

This method will be called when you try to unset a property that doesn’t exist in the class. For this class, this method will execute State::let() internally.

Example

$state = new State(['test' => 1]);

unset($state->test);

echo $state->test; // Returns `null`

Method name will be normalized by function p2f(). So, when you try to unset $state->dateFormat property for example, internally you are trying to unset a state with name date-format. This is also the same when you try to unset $state->{'date-format'} property. No normalization will be performed in this case.

State::__unset()

Deletes a state via property access.