Re: Getting ahold of calling symbol table

From: Date: Mon, 20 Nov 2000 20:32:42 +0000
Subject: Re: Getting ahold of calling symbol table
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-38671@lists.php.net to get a copy of this message
Just wondering - when would you need it? At first glance, it appears to go against some basic scope guidelines... Zeev At 22:24 20/11/2000, Andrei Zmievski wrote:
I've run into a few situation where I needed to know values of variables as they existed in the outer calling scope. Having failed to locate a way to do it generically I came up with the attached patch. It changes a couple of things in Zend and implements a get_calling_symbol_table() function. <? foo(); function foo() {
    $bar = 5;
    bar();
} function bar() {
    var_dump(get_calling_symbol_table());
} ?> Results in: array(1) { ["bar"]=> int(5) } If no one objects, I'd like to go ahead and commit it. -Andrei * There is no knowledge that is not power. * -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> CTO, Zend Technologies Ltd. http://www.zend.com/

« previous php.dev (#38671) next »