memory = $memory; $this->memoryLimit = $memoryLimit; $this->global = $isGlobal; $this->triggerCount = $triggerCount; } /** * Returns the memory usage at the time of the event call (in bytes) * * @return int */ public function getMemory() : int{ return $this->memory; } /** * Returns the memory limit defined (in bytes) * * @return int */ public function getMemoryLimit() : int{ return $this->memoryLimit; } /** * Returns the times this event has been called in the current low-memory state * * @return int */ public function getTriggerCount() : int{ return $this->triggerCount; } /** * @return bool */ public function isGlobal() : bool{ return $this->global; } /** * Amount of memory already freed * * @return int */ public function getMemoryFreed() : int{ return $this->getMemory() - ($this->isGlobal() ? Process::getMemoryUsage(true)[1] : Process::getMemoryUsage(true)[0]); } }