app/Individual.php
public function numberOfChildren(): int
    {
        if (preg_match('/\n1 NCHI (\d+)(?:\n|$)/', $this->gedcom(), $match)) {
            return (int) $match[1];
        }

        $children = [];
        foreach ($this->spouseFamilies() as $fam) {
            foreach ($fam->children() as $child) {
                $children[$child->xref()] = true;
            }
        }

        return count($children);
    }
public function numberOfChildren(): int
    {
        if (preg_match('/\n1 NCHI (\d+)(?:\n|$)/', $this->gedcom(), $match)) {
            return (int) $match[1];
        }

        $children = [];
        foreach ($this->spouseFamilies() as $fam) {
            foreach ($fam->children() as $child) {
                $children[$child->xref()] = true;
            }
        }

        return count($children);
    }
public function numberOfChildren ( ) : int { if ( preg_match ( '/\n1 NCHI (\d+)(?:\n|$)/' , $ this -> gedcom ( ) , $ match ) ) { return ( int ) $ match [ 1 ] ; } $ children = [ ] ; foreach ( $ this -> spouseFamilies ( ) as $ fam ) { foreach ( $ fam -> children ( ) as $ child ) { $ children [ $ child -> xref ( ) ] = true ; } } return count ( $ children ) ; }
Count the children belonging to this individual.

@return int
Count the children belonging to this individual .