You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
471 B
21 lines
471 B
<?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); |
|
} |
|
} |
|
} |
|
} |