note 27366 added to zend.variables.object
| From: | jo-shi at web dot de | Date: | Tue, 03 Dec 2002 16:47:59 +0000 |
| Subject: | note 27366 added to zend.variables.object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40300@lists.php.net to get a copy of this message | ||
you can add functions to your object:
you may declare global
static zend_function_entry
php_my_class_functions[] = {
ZEND_FE (func1, NULL)
ZEND_FE (func2, NULL)
{NULL, NULL, NULL}
};
you may declare local
zend_class_entry my_class_entry;
zend_class_entry *ce;
you should do something like this
INIT_CLASS_ENTRY(
func_class_entry,
"CLASSNAME",
php_my_class_functions);
ce = emalloc(sizeof(zend_class_entry));
ce = zend_register_internal_class (
&my_class_entry TSRMLS_CC);
object_init_ex(return_value, ce);
this should produce a returned object in your php_code:
$myobj = yourfunc(/*yourparams*/);
$myobj->func1();
$myobj->func2();
--
http://www.php.net/manual/en/zend.variables.object.php
http://master.php.net/manage/user-notes.php?action=edit+27366
http://master.php.net/manage/user-notes.php?action=delete+27366
http://master.php.net/manage/user-notes.php?action=reject+27366