Generally, you can trust GC to do the right thing. PHP has had some nasty garbage-collection bugs though (e.g. https://bugs.php.net/bug.php?id=50027 )
miniblog.
Related Posts
Most of the code I write is in a garbage collected language.
I'm often surprised how much extra performance I can get when I can control allocations. I saved ~10% runtime in difftastic by moving to a zero-allocation colour library (owo_colours)!
I've been tinkering with some garbage collection approaches for a toy language.
Comparing refcounting with mark-and-sweep, the latter seems less error-prone. 'Values in list X but not in Y' is less scary to implement than 'every incref should have a decref'. Agree/disagree?
The development of multicore Haskell, its runtime and garbage collector: