<p>I have a PHP class that creates a PNG image on the fly and sends it to browser. PHP manual says that I need to make sure that <em>imagedestroy</em> function is called at end to release the memory. Now, if I weren't using a class, I would have some code like this:</p>

<pre><code>function shutdown_func() 
{
    global $img;
    if ($img)
        imagedestroy($img);
}
register_shutdown_function("shutdown_func");
</code></pre>

<p>However, I believe that appropriate place for my class would be to place a call to <em>imagedestroy</em> in class' destructor.</p>

<p>I failed to find out if destructors get called the same way shutdown functions does? For example, if execution stops when user presses the STOP button in browser.</p>

<p>Note: whatever you write in your answer, please point to some article or manual page (URL) that supports it.</p>

I think one big thing that you have missed is that all the memory PHP has allocated during script execution is freed once the script terminates. Even if the user presses the stop-button, PHP processes the script until it is finished, gives it back to the HTTP daemon to be served to the visitor (or not, depending on how clever the daemon is).
So, explicitly freeing up memory at the end of script execution is a bit redundant. Some might argue that it would be a good thing to do, but it's still redundant.
But, on the topic of class destructors, they are called whenever the object is destroyed, either explicitly by
```
unset()
```
or at script completion/termination.
The recommendation of the developer explicitly freeing up the memory used in image manipulation is sure just to make absolutely sure not to have a memory leak, as bitmaps can be straining on the memory side of things (height * width * bit depth * 3 (+ 1 if you have an alpha channel))
To satisfy your Wikipedian needs:
http://php.net/manual/en/language.oop5.decon.php
http://php.net/manual/en/function.unset.php