Null / False / leer Properties löschen

trait TClearNullProperties
{
  public function clear_null_properties()
  {

    foreach (get_object_vars($this) as $key => $val) {
      if ($this->$key == false) {
        unset($this->$key);
      }
    }

  }

}