public function get() { if (!$this->invoked) { $function = $this->function; $this->cachedResult = $function(); $this->invoked = true; } return $this->cachedResult; }