PHP extension implementing a magic "Comparable" interface