diff options
-rw-r--r-- | Zend/zend_API.c | 10 | ||||
-rw-r--r-- | Zend/zend_API.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 23db2b88f1..5b4458702c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -491,6 +491,16 @@ ZEND_API inline int add_property_long(zval *arg, char *key, long n) return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL); } +ZEND_API inline int add_property_resource(zval *arg, char *key, long n) +{ + zval *tmp = (zval *) emalloc(sizeof(zval)); + + tmp->type = IS_RESOURCE; + tmp->value.lval = n; + INIT_PZVAL(tmp); + return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL); +} + ZEND_API inline int add_property_double(zval *arg, char *key, double d) { diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 9e65b1d80d..e4da69804e 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -116,6 +116,7 @@ ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval ZEND_API int add_property_long(zval *arg, char *key, long l); +ZEND_API int add_property_resource(zval *arg, char *key, long r); ZEND_API int add_property_double(zval *arg, char *key, double d); ZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate); ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate); |