note 27366 deleted from internals2.ze1.zendapi by cmb
| From: | cmb@php.net | Date: | Sun, 10 Jan 2021 13:26:32 +0000 |
| Subject: | note 27366 deleted from internals2.ze1.zendapi by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216139@lists.php.net to get a copy of this message | ||
Note Submitter: jo-shi at web dot de
----
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();