Re: [PHP4BETA] some api stuff from php3 variables.c
| From: | Zeev Suraski | Date: | Mon, 05 Jul 1999 01:00:19 +0000 |
| Subject: | Re: [PHP4BETA] some api stuff from php3 variables.c | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-1883@lists.php.net to get a copy of this message | ||
At 15:42 04/07/99 , Thies C. Arntzen wrote:
hi zeev, andy,Andi's gone till Thursday...
things like: php3i_long_pval & friend don't exist in php4 currently - will you put them into the "official" zend api?What do they do?
one question, what is the "official" descructor function that modules should use (zend_dtor)? and what do we need to do for the ELS stuff when destructing?I don't think you need to supply a destructor pointer anywhere - if you're using API functions. If you need to directly destroy a zval, use zval_dtor(). Don't supply zval_dtor() as a destructor function for symbol table hashes though (again, I don't think any non-Zend code should be directly supplying a hash destructor function, but should be using array_init() or object_init() instead).
and again, what is the "official" way to create a new pval - as i mentioned before i think that: pval *value = emalloc(sizeof(pval)); value->type = IS_STRING; value->value.str.len = size; value->value.str.val = estrndup(column->data,size); will leave is_ref and refcount in a undefined state, which is not what we want - what would be the disadvantage for having an api-call for that?In fact, as I said, you rarely care about refcount - Zend takes care of it for you as long as you use API functions. For example, you never have to set up the reference count information for return_value in internal function implementations. You also don't have to set up the reference count information for any array elements you set using add_assoc_long() and friends. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il