public function fetchColumn($fieldIndex): array
    {
        $this->checkFieldIndex($fieldIndex);
        if (is_string($fieldIndex)) {
            $fieldIndex = $this->namesHash[$fieldIndex];
        }

        $result = [];
        for ($i = 0; $i < $this->numRows; $i++) {
            $result[] = $this->converters[$fieldIndex]->input(
                pg_fetch_result($this->resource, $i, $fieldIndex)
            );
        }
        return $result;
    }
public function fetchColumn($fieldIndex): array
    {
        $this->checkFieldIndex($fieldIndex);
        if (is_string($fieldIndex)) {
            $fieldIndex = $this->namesHash[$fieldIndex];
        }

        $result = [];
        for ($i = 0; $i < $this->numRows; $i++) {
            $result[] = $this->converters[$fieldIndex]->input(
                pg_fetch_result($this->resource, $i, $fieldIndex)
            );
        }
        return $result;
    }
public function fetchColumn ( $ fieldIndex ) : array { $ this -> checkFieldIndex ( $ fieldIndex ) ; if ( is_string ( $ fieldIndex ) ) { $ fieldIndex = $ this -> namesHash [ $ fieldIndex ] ; } $ result = [ ] ; for ( $ i = 0 ; $ i < $ this -> numRows ; $ i ++ ) { $ result [ ] = $ this -> converters [ $ fieldIndex ] -> input ( pg_fetch_result ( $ this -> resource , $ i , $ fieldIndex ) ) ; } return $ result ; }
Returns an array containing all values from a given column in the result set

@param string|int $fieldIndex Either a column name or an index (0-based)
@return array
@throws exceptions\InvalidArgumentException
Returns an array containing all values from a given column in the result set