Re: Re: confusion reading using zend_hash_exists()
| From: | Nathan Nobbe | Date: | Mon, 23 Feb 2009 19:06:45 +0000 |
| Subject: | Re: Re: confusion reading using zend_hash_exists() | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-6155@lists.php.net to get a copy of this message | ||
On Mon, Feb 23, 2009 at 12:45 AM, Michael Wallner <mike@php.net> wrote:
> Nathan Nobbe wrote:
>
> if(zend_hash_exists(Z_ARRVAL_P(proxyMap),
>> rawProxyName, rawProxyNameLength)) {
>>
> ^^^^^^^^^^^^^^^^^^
>
> A hash key is made up including the terminating zero, so the hash key
> length is the length of the key string plus one. Don't you add the
> proxies to the proxyMap your self with zend_hash_add? There you'd
> be using length+1 either.
>
thx for the reply,
i got both rawProxyName, and rawProxyNameLength from
zend_parse_parameters(). dumping out the value of rawProxyNameLength shows
it as 9, so clearly i need to add 1, and that did the trick! thanks mate,
ill have to keep a closer eye on my arithmatic :)
-nathan