Re: [PHP-DEV] Cloning of objects passed as parameters

2009-03-13 Thread Frankie Dintino
Sorry to spam the list with a reply to my own thread again, but there were some errors in the example I posted, which would defeat the whole idea of it being useful for somebody with the same question. Corrected example: ZEND_METHOD(xydelta, setStartDocument) { zval *id, *doc = NULL; xyd

Re: [PHP-DEV] Cloning of objects passed as parameters

2009-03-11 Thread Frankie Dintino
Thanks Marcus, Actually, persistence wasn't the only issue. I had to make sure that the DOMDocument wasn't later modified, as that could lead to weird behavior. Basically, what i needed was a way to pass an object by copy rather than by reference, as it was in ZE1. I figured out a solution, s

Re: [PHP-DEV] Cloning of objects passed as parameters

2009-03-10 Thread Marcus Boerger
Hello Frankie, Tuesday, March 10, 2009, 5:19:32 PM, you wrote: > I'm writing a PHP class with a method that has to be passed a > DOMDocument object, and it needs to retain that object throughout the > life of its instantiation. However, the (dom_object *) returned from > zend_parse_method_para

[PHP-DEV] Cloning of objects passed as parameters

2009-03-10 Thread Frankie Dintino
I'm writing a PHP class with a method that has to be passed a DOMDocument object, and it needs to retain that object throughout the life of its instantiation. However, the (dom_object *) returned from zend_parse_method_parameters is just a pointer to the passed object, and so it disappears when