Re: Re: Get object name

From: Date: Mon, 04 Mar 2002 21:58:24 +0000
Subject: Re: Re: Get object name
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-80709@lists.php.net to get a copy of this message
l0t3k wrote:
you can do this only with a not-so nice hack. essentially you have to manually search the active symbol table stack for a zval * which equals your variable. zend_hash_find wont help you, since you're doing a "reverse" lookup.
... and your chances of getting the right name in case of assignments by reference are 50/50: <?php $a = new obj(); $b = &$a; $a->print_obj_name(); $b->print_obj_name(); ?> reuslt will be either a a or b b but not a b -- Hartmut Holzgraefe hartmut@six.de http://www.six.de +49-711-99091-77 Wir stellen für Sie aus auf der CeBIT 2002 und freuen uns in Halle 6 auf Ihren Besuch am Stand H 18

« previous php.dev (#80709) next »