src/PriorityQueue.php
private function compare(int $a, int $b)
    {
        $x = $this->heap[$a];
        $y = $this->heap[$b];

        // Compare priority, using insertion stamp as fallback.
        return ($x->priority <=> $y->priority) ?: ($y->stamp <=> $x->stamp);
    }
private function compare(int $a, int $b)
    {
        $x = $this->heap[$a];
        $y = $this->heap[$b];

        // Compare priority, using insertion stamp as fallback.
        return ($x->priority <=> $y->priority) ?: ($y->stamp <=> $x->stamp);
    }
private function compare ( int $ a , int $ b ) { $ x = $ this -> heap [ $ a ] ; $ y = $ this -> heap [ $ b ] ; // Compare priority, using insertion stamp as fallback. return ( $ x -> priority <=> $ y -> priority ) ? : ( $ y -> stamp <=> $ x -> stamp ) ; }
Compares two indices of the heap.

@param int $a
@param int $b

@return int
Compares two indices of the heap .