diff options
author | Xinchen Hui <laruence@php.net> | 2014-06-18 23:37:47 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2014-06-18 23:37:47 +0800 |
commit | 17f35c9a295a55b8af09a5c8ba7dbc8894d3861b (patch) | |
tree | cbd1f091c85ea6bbd361196244d4aa7bc3f04ad4 /sapi/phpdbg/phpdbg_utils.h | |
parent | b38f6f3de96990163d36c82c248fb29e6f0815c4 (diff) | |
parent | b108267f2c5c09bd153cfb1d4e580d5fc9c52d51 (diff) | |
download | php-git-17f35c9a295a55b8af09a5c8ba7dbc8894d3861b.tar.gz |
Merge branch 'phpng' of git.php.net:php-src into phpng
Diffstat (limited to 'sapi/phpdbg/phpdbg_utils.h')
-rw-r--r-- | sapi/phpdbg/phpdbg_utils.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h index 68ae7e44a3..56bacfc459 100644 --- a/sapi/phpdbg/phpdbg_utils.h +++ b/sapi/phpdbg/phpdbg_utils.h @@ -124,4 +124,24 @@ PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D); /* }}} */ int phpdbg_rebuild_symtable(TSRMLS_D); +#if PHP_VERSION_ID < 50500 +/* copy from zend_hash.c PHP 5.5 for 5.4 compatibility */ +static void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) { + Bucket *p; + + p = pos ? (*pos) : ht->pInternalPointer; + + if (!p) { + Z_TYPE_P(key) = IS_NULL; + } else if (p->nKeyLength) { + Z_TYPE_P(key) = IS_STRING; + Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char*)p->arKey : estrndup(p->arKey, p->nKeyLength - 1); + Z_STRLEN_P(key) = p->nKeyLength - 1; + } else { + Z_TYPE_P(key) = IS_LONG; + Z_LVAL_P(key) = p->h; + } +} +#endif + #endif /* PHPDBG_UTILS_H */ |