DEV Community

Debajyoti Das
Debajyoti Das

Posted on

Debugging PHP memory

Unsetting might be a very basic thing, but writing code with unsetting variables after it's work is finished can save memory.

unset($unique_commission); //Array
dd(memory_get_usage());

O/P: 18596688

//unset($unique_commission); //Array
dd(memory_get_usage());

O/P: 18594392
Enter fullscreen mode Exit fullscreen mode

Top comments (0)