CPHPArray::CPHPArray(zval* arr) { m_arr = arr; ZVAL_ADDREF(m_arr); zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(m_arr), &m_pos); get_next_num_item(m_arr, &m_pos); };
int main(int argc, char ** argv) { zval t1, * pt2, ** ppt3; INIT_ZVAL(t1); Z_TYPE(t1) = IS_LONG; Z_LVAL(t1) = 54321; zval_print(&t1); ALLOC_INIT_ZVAL(pt2); ZVAL_STRING(pt2, "this is string val.", 1); zval_print(pt2); *ppt3 = pt2; ZVAL_ADDREF(*ppt3); zval_print(*ppt3); //zval_copy_ctor(*ppt3); SEPARATE_ZVAL(ppt3); zval_print(*ppt3); zval_print(pt2); Z_TYPE(t1) = IS_BOOL; Z_LVAL(t1) = 1; zval_print(&t1); Z_TYPE(t1) = IS_DOUBLE; Z_DVAL(t1) = 20.12; zval_print(&t1); /* zval_dtor(pt2); FREE_ZVAL(pt2); zval_dtor(*ppt3); FREE_ZVAL(*ppt3); */ }
PHPDBXmlResolver &operator=(const PHPDBXmlResolver &o) { zval_ptr_dtor(&m_userspace); m_userspace = o.m_userspace; ZVAL_ADDREF(m_userspace); }
PHPDBXmlResolver(zval *userspace) { m_userspace = userspace; ZVAL_ADDREF(m_userspace); }