What is this comment in zend_object_handlers.h ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
witheredOldMale
Forum Newbie
Posts: 5
Joined: Wed Apr 22, 2009 1:49 pm

What is this comment in zend_object_handlers.h ?

Post by witheredOldMale »

/* The following rule applies to read_property() and read_dimension() implementations:
If you return a zval which is not otherwise referenced by the extension or the engine's
symbol table, its reference count should be 0.
*/
/* Used to fetch property from the object, read-only */
typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC);

/* Used to fetch dimension from the object, read-only */
typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC);


I can't understnd why they say the reference count of a returned object should be 0. How will the object live? Please explain.
Post Reply