# SplHeap->key()

- Thread: https://externals.io/message/41994
- Original archive: https://news-web.php.net/php.internals/41994
- Started by Tobias Schlitt on 2008-11-19T10:23:34+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #41994 — Tobias Schlitt — 2008-11-19T10:23:34+00:00

URL: https://externals.io/message/41994#41994

Hi!

I noticed that SplHeap returns the current element count of the heap
from `key()`. I think it should return count - 1 to reflect 0 indexing.
key won't be called outside of an iterator, so this makes sense.

Regards,
Toby
-- 
Tobias Schlitt - Zend Certification Member       GPG Key: 0xC462BC14
a passion for php                            http://www.schlitt.info
Member of the eZ components project          http://components.ez.no

---

## #41995 — David Coallier — 2008-11-19T10:38:41+00:00

URL: https://externals.io/message/41994#41995 · In reply to: #41994

>
> I noticed that SplHeap returns the current element count of the heap
> from `key()`. I think it should return count - 1 to reflect 0 indexing.
> key won't be called outside of an iterator, so this makes sense.
>

I'd say this is a bug as well, would you mind opening a bug and
assigning it to me please?

Etienne/Marcus, do you mind if I go ahead?

-- 
Slan,
David

---

## #41998 — Tobias Schlitt — 2008-11-19T13:36:36+00:00

URL: https://externals.io/message/41994#41998 · In reply to: #41995

Hi,

On 11/19/2008 11:38 AM David Coallier wrote:
> > […]

> I'd say this is a bug as well, would you mind opening a bug and
> assigning it to me please?

Done.

Cheers,
Toby
-- 
Tobias Schlitt - Zend Certification Member       GPG Key: 0xC462BC14
a passion for php                            http://www.schlitt.info
Member of the eZ components project          http://components.ez.no
