Using SplHeap to order objects

Code
<?php

class Data
{
    public 
$value;
    
    public function 
__construct($value)
    {
        
$this->value $value;
    }
}

class 
MyHeap extends SplHeap
{
    protected function 
compare($val1$val2)
    {
        return 
strcmp(
            
$val2->value,
            
$val1->value
        
);
    }
}

$heap = new MyHeap();
$heap->insert(new Data('foo'));
$heap->insert(new Data('baz'));
$heap->insert(new Data('qux'));
$heap->insert(new Data('bar'));

foreach (
$heap as $data) {
    echo 
$data->value PHP_EOL;
}
Result
bar
baz
foo
qux
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6