summaryrefslogtreecommitdiff
path: root/Zend/zend_objects_API.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-05-17 11:27:16 +0000
committerWez Furlong <wez@php.net>2004-05-17 11:27:16 +0000
commit3a4f33e31ff77da46b24b2651fed259ca52104c6 (patch)
treebcb17680f117dfa4a72fcda593bd2631ca24e267 /Zend/zend_objects_API.c
parent7d15d8cc3e7c967272458028b63fe58ca0d5773d (diff)
downloadphp-git-3a4f33e31ff77da46b24b2651fed259ca52104c6.tar.gz
As discussed with Andi, add this helper API for setting the object pointer from
within the constructor. Please read the comment for notes about how to use it; in general, you don't need it, so don't use it.
Diffstat (limited to 'Zend/zend_objects_API.c')
-rw-r--r--Zend/zend_objects_API.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 95a36a1781..69a33b525b 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -190,6 +190,20 @@ ZEND_API void *zend_object_store_get_object(zval *zobject TSRMLS_DC)
return EG(objects_store).object_buckets[handle].bucket.obj.object;
}
+/* zend_object_store_set_object:
+ * It is ONLY valid to call this function from within the constructor of an
+ * overloaded object. Its purpose is to set the object pointer for the object
+ * when you can't possibly know its value until you have parsed the arguments
+ * from the constructor function. You MUST NOT use this function for any other
+ * weird games, or call it at any other time after the object is constructed.
+ * */
+ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC)
+{
+ zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
+
+ EG(objects_store).object_buckets[handle].bucket.obj.object = object;
+}
+
/* Proxy objects workings */
typedef struct _zend_proxy_object {