3 ms·
PHP has garbage collection now, so it's a lot harder to cause a memory leak. Before PHP 5.3.0, cyclical references were one of the biggest causes of memory leak
by jmcgough 10y ago
PHP has garbage collection now, so it's a lot harder to cause a memory leak. Before PHP 5.3.0, cyclical references were one of the biggest causes of memory leaks.
However, you can still create memory leaks just like you could in Ruby - dynamic allocation in a c extension that isn't freed up (like in this story), or creating objects that can't be garbage collected (like a slowing expanding array in a global variable).