diff options
author | Ondřej Surý <ondrej@sury.org> | 2014-06-20 12:01:47 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2014-06-20 12:01:47 +0200 |
commit | 60d44b592c4c4fdcbbf92db2882a97a9cc54713c (patch) | |
tree | 58f7068d9acde2338841263461fbf95d77a9ee2e /sapi/phpdbg/phpdbg_utils.h | |
parent | c63e1a09f5cbd757f59beb729fb0fb36516819a9 (diff) | |
download | php-60d44b592c4c4fdcbbf92db2882a97a9cc54713c.tar.gz |
New upstream version 5.6.0~rc1+dfsgupstream/5.6.0_rc1+dfsg
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 68ae7e44a..56bacfc45 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 */ |