# Hash entries added with keys without trailing null

- Thread: https://externals.io/message/23008
- Original archive: https://news-web.php.net/php.internals/23008
- Started by Michael Wallner on 2006-04-28T14:19:13+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

---

## #23008 — Michael Wallner — 2006-04-28T14:19:13+00:00

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

Hi,

I wonder if the few places where entries are added and the terminating null
of the array key is not honored are intentional or by mistake?

AFAICS at least these places are affected:
	- Registered PHP Streams
	- Registered Stream Socket Transports
	- Registered Stream Filters
	- URL-Rewriter vars
	- PDO drivers
	- GIF logo UIDs
	- LD_LIBRARY_PATH (dunno where this comes from)

JFYI, I stumbled accross these while placing a debug output in zend_hash_update(),
because I faced some weird behaviour when `print_r()` showed array entries
not accessible by array key (caused by my own mistakes).

Thanks,
-- 
Michael - <mike(@)php.net> http://dev.iworks.at/ext-http/http-functions.html.gz

---

## #23015 — Wez Furlong — 2006-04-28T23:59:35+00:00

URL: https://externals.io/message/23008#23015 · In reply to: #23008

> Hi,
>
> I wonder if the few places where entries are added and the terminating null
> of the array key is not honored are intentional or by mistake?
>
> AFAICS at least these places are affected:
>         - Registered PHP Streams
>         - Registered Stream Socket Transports
>         - Registered Stream Filters
>         - PDO drivers

These are all intentional; there is no need to store nor compare
against that NUL byte.

--Wez.

---

## #23025 — Michael Wallner — 2006-04-29T11:16:56+00:00

URL: https://externals.io/message/23008#23025 · In reply to: #23015

Wez Furlong wrote:
> 
> 
> > […]
> 
> 
> These are all intentional; there is no need to store nor compare
> against that NUL byte.

Okay, thank you.

-- 
Michael - <mike(@)php.net> http://dev.iworks.at/ext-http/http-functions.html.gz
