public static function __set_state(array $array) { $obj = new static(); foreach ($array as $k => $v) { $obj->{$k} = $v; } return $obj; }