- Bug #46615
- Return the count - 1 when invoking SplHeap->key()
- Adjusted the tests
SPL_METHOD(SplHeap, key)
{
spl_heap_object *intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
-
- RETURN_LONG(intern->heap->count);
+
+ RETURN_LONG(intern->heap->count - 1);
}
/* }}} */
$h->rewind();
echo "count(\$h) = ".count($h)."\n";
echo "\$h->count() = ".$h->count()."\n";
+
while ($h->valid()) {
$k = $h->key();
$v = $h->current();
--EXPECTF--
count($h) = 4
$h->count() = 4
-4=>5
-3=>4
-2=>1
-1=>0
+3=>5
+2=>4
+1=>1
+0=>0
===DONE===
--EXPECTF--
count($h) = 4
$h->count() = 4
-4=>5
-3=>4
-2=>1
-1=>0
+3=>5
+2=>4
+1=>1
+0=>0
===DONE===