public function search($interval)
    {
        if (is_null($this->top_node)) {
            return array();
        }

        $result = $this->find_intervals($interval);
        $result = array_values($result);

        usort($result, function (RangeInterface $a, RangeInterface $b) {
            $x = $a->getStart();
            $y = $b->getStart();

            $comparedValue = $this->compare($x, $y);

            if ($comparedValue == 0) {
                $x = $a->getEnd();
                $y = $b->getEnd();
                $comparedValue = $this->compare($x, $y);
            }

            return $comparedValue;
        });

        return $result;
    }
public function search($interval)
    {
        if (is_null($this->top_node)) {
            return array();
        }

        $result = $this->find_intervals($interval);
        $result = array_values($result);

        usort($result, function (RangeInterface $a, RangeInterface $b) {
            $x = $a->getStart();
            $y = $b->getStart();

            $comparedValue = $this->compare($x, $y);

            if ($comparedValue == 0) {
                $x = $a->getEnd();
                $y = $b->getEnd();
                $comparedValue = $this->compare($x, $y);
            }

            return $comparedValue;
        });

        return $result;
    }
public function search ( $ interval ) { if ( is_null ( $ this -> top_node ) ) { return array ( ) ; } $ result = $ this -> find_intervals ( $ interval ) ; $ result = array_values ( $ result ) ; usort ( $ result , function ( RangeInterface $ a , RangeInterface $ b ) { $ x = $ a -> getStart ( ) ; $ y = $ b -> getStart ( ) ; $ comparedValue = $ this -> compare ( $ x , $ y ) ; if ( $ comparedValue == 0 ) { $ x = $ a -> getEnd ( ) ; $ y = $ b -> getEnd ( ) ; $ comparedValue = $ this -> compare ( $ x , $ y ) ; } return $ comparedValue ; } ) ; return $ result ; }
Search for ranges that overlap the specified value or range.

@param mixed $interval Either a RangeInterface or a value.

@return array
Search for ranges that overlap the specified value or range .