final public function keyValue(string $keyExpression, string $valueExpression): array
    {
        $keyNodes = $this->query($keyExpression);
        $valueNodes = $this->query($valueExpression);
        if ($keyNodes->length !== $valueNodes->length) {
            throw new \RuntimeException('Keys and values must have equal numbers of elements');
        }
        $result = [];
        foreach ($keyNodes as $index => $node) {
            $result[$node->nodeValue] = $valueNodes->item($index)->nodeValue;
        }
        return $result;
    }
final public function keyValue(string $keyExpression, string $valueExpression): array
    {
        $keyNodes = $this->query($keyExpression);
        $valueNodes = $this->query($valueExpression);
        if ($keyNodes->length !== $valueNodes->length) {
            throw new \RuntimeException('Keys and values must have equal numbers of elements');
        }
        $result = [];
        foreach ($keyNodes as $index => $node) {
            $result[$node->nodeValue] = $valueNodes->item($index)->nodeValue;
        }
        return $result;
    }
final public function keyValue ( string $ keyExpression , string $ valueExpression ) : array { $ keyNodes = $ this -> query ( $ keyExpression ) ; $ valueNodes = $ this -> query ( $ valueExpression ) ; if ( $ keyNodes -> length !== $ valueNodes -> length ) { throw new \ RuntimeException ( 'Keys and values must have equal numbers of elements' ) ; } $ result = [ ] ; foreach ( $ keyNodes as $ index => $ node ) { $ result [ $ node -> nodeValue ] = $ valueNodes -> item ( $ index ) -> nodeValue ; } return $ result ; }
Return array of keys and values

@param string $keyExpression
@param string $valueExpression
@throws \Exception
@return array
Return array of keys and values