Is it necessary to use the __destruct
method and set the variables of the class with null
to free up memory more efficiently?
For example:
class Teste {
public $foo;
public $bar;
// ...
public function __construct() {
// ...
}
public function __destruct() {
$this->foo = null;
$this->bar = null;
}
}