protected function filter_nlastchild($n) { if ($this->parent === null) { return false; } else { return $this->parent->childCount(true) - $this->index(false) === (int) $n; } }