# VarStorable

The VarStorable component is in charge of handling a variable that can be stored (state).

# Storable variables

A storable variable for Chevere is any PHP variable that can be stored as a string representation. All variable types can be stored in PHP with the exception of type resource.

# Creating VarStorable

use Chevere\Components\VarStorable\VarStorable;

$varStorable = new VarStorable(var: $var);

# Export

The toExport method provides a shortcut for var_export($var, true).

/**
 * @var string $export
 */
$export = $varStorable->toExport();

# Serialize

The toSerialize method provides a shortcut for serialize($var).

/**
 * @var string $serialize
 */
$serialize = $varStorable->toSerialize();