Get object name
| From: | Klaus Reimer | Date: | Mon, 04 Mar 2002 20:11:04 +0000 |
| Subject: | Get object name | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-80704@lists.php.net to get a copy of this message | ||
Hi,
I need to acces the name of an object in a class method written in C. How can
I do this? Example:
I have the following PHP code
$Test=new CMyClass();
$Test->print_obj_name();
and I have the following print_obj_name()-method written in C:
ZEND_NAMED_FUNCTION(cmyclass_print_obj_name) {
zend_printf("%s\n",doSomethingMagic());
}
How can I do the doSomethingMagic() part so my method prints the object name
("Test")? I can access the CLASS name with
getThis()->value.obj.ce->name
but I need the variable name of the class instance ("Test" in this case). How
can I do this?
--
Bye, K <http://www.ailis.de/~k/>
[A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391]
(Finger k@ailis.de to get public key)