-static zend_object *bbcode_clone(zval *obj TSRMLS_DC) {
-
- bbcode_object *oldobj = (bbcode_object *)((char *)obj - XtOffsetOf(bbcode_object, std));
-
- printf("bbcode_clone=%d\n", sizeof(bbcode_object) + zend_object_properties_size(Z_OBJCE_P(obj)));
-
- bbcode_object *newobj = ecalloc(1, sizeof(bbcode_object) + zend_object_properties_size(Z_OBJCE_P(obj)));
-
- zend_object_std_init(&newobj->std, Z_OBJCE_P(obj) TSRMLS_CC);
- object_properties_init(&newobj->std, Z_OBJCE_P(obj) TSRMLS_CC);
-
- //newobj->std.handlers = &bbcode_handlers;
-
- zend_objects_clone_members(&newobj->std, &oldobj->std);
-
-#if 0
- bbcode_object *oldobj = (bbcode_object *)((char *)obj - XtOffsetOf(bbcode_object, std));
- zend_object *newobj_val = bbcode_create(Z_OBJCE_P(obj) TSRMLS_CC);
- bbcode_object *newobj = (bbcode_object *)((char *)newobj_val - XtOffsetOf(bbcode_object, std));
-
- zend_objects_clone_members(&newobj->std, &oldobj->std);
-#endif
-
- /*XXX: clone flag member*/
- newobj->flag = oldobj->flag;
-
- /* TODO: clone the members of bbcode_object
- newobj->buffer = oldobj->buffer;
- newobj->length = oldobj->length;
-
- if (oldobj->flag) {
- newobj->buffer = emalloc(oldobj->length);
- memcpy(newobj->buffer, oldobj->buffer, oldobj->length);
- }*/
-
- return &newobj->std;
-}