/** * Generate name if it doesn't exist * * @param mixed $offset The name of the variable * * @return mixed */ public function &offsetGet($offset) { if ($offset === 'name' && !parent::offsetGet('name')) { parent::offsetSet('name', spl_object_hash($this)); } return parent::offsetGet($offset); }