public function __wakeup() { self::$idCounter = $this->idCounterSerialized; //restore the static var }