zend api question

From: Date: Tue, 10 Aug 1999 13:35:40 +0000
Subject: zend api question
Groups: php.dev 
Request: Send a blank email to php-dev+get-9716@lists.php.net to get a copy of this message
Hi, I have started to add another xml module (close to the DOM interface) to php4. When I tried to create an array of objects I realized that I have to call INIT_PZVAL() on each object which is not needed for the array. I wonder what INIT_PZVAL() is for and why it isn't called in object_init[_ex]() ? Here is my to code to accomplish the above. Does this make sense? if (array_init(return_value) == FAILURE) { RETURN_FALSE; } while(last) { zval *child; child = (zval *) emalloc(sizeof(zval)); ret = php3_list_insert(last, le_domxmlnodep); /* construct a node object */ object_init_ex(child, domxmlnode_class_entry_ptr); add_property_stringl(child, "name", last->name, strlen(last->name), 1); add_property_long(child, "node", ret); INIT_PZVAL(child); zend_hash_next_index_insert(return_value->value.ht, &child, sizeof(zval *), NULL); last = last->next; } Uwe -- Uwe.Steinmann@fernuni-hagen.de Tel: +2331 987 4528 Fax: +2331 987 375

« previous php.dev (#9716) next »