public function getFirstChildNode(...$classNames) {
        foreach ($this::CHILD_NAMES as $name) {
            $val = $this->$name;
            foreach ($classNames as $className) {
                if (\is_array($val)) {
                    foreach ($val as $child) {
                        if ($child instanceof $className) {
                            return $child;
                        }
                    }
                    continue;
                } elseif ($val instanceof $className) {
                    return $val;
                }
            }
        }
        return null;
    }
public function getFirstChildNode(...$classNames) {
        foreach ($this::CHILD_NAMES as $name) {
            $val = $this->$name;
            foreach ($classNames as $className) {
                if (\is_array($val)) {
                    foreach ($val as $child) {
                        if ($child instanceof $className) {
                            return $child;
                        }
                    }
                    continue;
                } elseif ($val instanceof $className) {
                    return $val;
                }
            }
        }
        return null;
    }
public function getFirstChildNode ( ... $ classNames ) { foreach ( $ this :: CHILD_NAMES as $ name ) { $ val = $ this -> $ name ; foreach ( $ classNames as $ className ) { if ( \ is_array ( $ val ) ) { foreach ( $ val as $ child ) { if ( $ child instanceof $ className ) { return $ child ; } } continue ; } elseif ( $ val instanceof $ className ) { return $ val ; } } } return null ; }
Gets first child that is an instance of one of the provided classes.
Returns null if there is no match.

@param array ...$classNames
@return Node|null
Gets first child that is an instance of one of the provided classes . Returns null if there is no match .