control-freak-ide/server/nodejs/util/docscripts/lib/parser2/Destructable.php
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

21 lines
471 B
PHP

<?php
abstract class Destructable {
protected function mem_flush() {
foreach (func_get_args() as $key) {
if ($this->$key) {
if (is_object($this->$key)) {
$this->$key->__destruct();
}
elseif (is_array($this->$key)) {
foreach ($this->$key as $loc => $value) {
if (is_object($value)) {
$value->__destruct();
}
}
}
unset($this->$key);
}
}
}
}