public function map(callable $callback)
    {
        $result = array();

        foreach ($this->nodes as $index => $node) {
            $return_value = \call_user_func($callback, $node, $index);

            if ($return_value === null) {
                continue;
            } elseif (\is_array($return_value)) {
                $result = \array_merge($result, $return_value);
            } else {
                $result[] = $return_value;
            }
        }

        return $result;
    }
public function map(callable $callback)
    {
        $result = array();

        foreach ($this->nodes as $index => $node) {
            $return_value = \call_user_func($callback, $node, $index);

            if ($return_value === null) {
                continue;
            } elseif (\is_array($return_value)) {
                $result = \array_merge($result, $return_value);
            } else {
                $result[] = $return_value;
            }
        }

        return $result;
    }
public function map ( callable $ callback ) { $ result = array ( ) ; foreach ( $ this -> nodes as $ index => $ node ) { $ return_value = \ call_user_func ( $ callback , $ node , $ index ) ; if ( $ return_value === null ) { continue ; } elseif ( \ is_array ( $ return_value ) ) { $ result = \ array_merge ( $ result , $ return_value ) ; } else { $ result [ ] = $ return_value ; } } return $ result ; }
Pass each element in the current matched set through a function,
producing an array containing the return values

@param callable $callback

@return array
Pass each element in the current matched set through a function producing an array containing the return values