<?php
final class My_Image() {
private $img;
public function __construct() {
$this->img = imagecreatetruecolor();
// ... other stuff ...
}
public function __destruct() {
if(is_resource($this->img)) {
imagedestroy($this->img);
}
}
// ... other methods...
}
?>
评论