I'm using PHP to process some image using GD extension. The code structure is rather complicated, images are allocated "deep" in the code and there are many IF's that simply bail-out. The script only processes a single image, and once it writes it to the file it exits.
I guess I could use try...catch instead, but I'm interested to know whether it is really needed to call imagedestroy() or PHP's garbage collector would free it when script ends?
No, you don't need to call this function, but it's a good practice because images can be large and if you are in a crowded environment every kilobyte counts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With