Re: confusion reading using zend_hash_exists()

From: Date: Mon, 23 Feb 2009 07:45:23 +0000
Subject: Re: confusion reading using zend_hash_exists()
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-6151@lists.php.net to get a copy of this message
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.
so, it looks like the proxyMap array has a value @ key "testProxy", and also "testProxy" has been correctly recieved by hasProxy() as the key to search for. proxyMap checks out to be an array, but for some reason the call to zend_hash_exists() isnt working. my gut tells me its something to do w/ Z_ARRVAL_P(), but thats returning the *HashTable pointer from proxyMap - that seems right.. any ideas why i cant find this hash?
Regards, Mike

« previous php.pecl.dev (#6151) next »