summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_utils.h
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2014-06-15 15:47:14 +0200
committerBob Weinand <bobwei9@hotmail.com>2014-06-15 15:47:14 +0200
commitf677889a9a536d506febc13e1022eb4816fb5fa1 (patch)
treeb43a2401c9df097d1753b6421e1a012c05e88661 /sapi/phpdbg/phpdbg_utils.h
parentda3ef175b98266e8920c326ff619d70ef8c375c3 (diff)
parente9c2e7d6e630ae660b6b5dc7269af58d4bf7bf54 (diff)
downloadphp-git-f677889a9a536d506febc13e1022eb4816fb5fa1.tar.gz
Merge sapi/phpdbg into PHP-5.6
Diffstat (limited to 'sapi/phpdbg/phpdbg_utils.h')
-rw-r--r--sapi/phpdbg/phpdbg_utils.h20
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 */