SplHeap::compare

SplHeap::compare

(PHP 5 >= 5.3.0, PHP 7)

SplHeap::compareCompare elements in order to place them correctly in the heap while sifting up.

Description

abstract protected int SplHeap::compare ( mixed $value1 , mixed $value2 )

Compare value1 with value2.

Warning

Throwing exceptions in SplHeap::compare() can corrupt the Heap and place it in a blocked state. You can unblock it by calling 登录查看完整内容