Hash entries added with keys without trailing null

php.internals

Michael Wallner

20 years ago
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

Wez Furlong

20 years ago
On 4/28/06, Michael Wallner <mike@php.net> wrote:
> 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.

Michael Wallner

20 years ago
Wez Furlong wrote:
> On 4/28/06, Michael Wallner <mike@php.net> wrote: > >> - 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.
Okay, thank you.
-- Michael - <mike(@)php.net> http://dev.iworks.at/ext-http/http-functions.html.gz