Re: [PHP-DEV] Making a variable global question

2003-08-01 Thread Zeev Suraski
At 03:44 01/08/2003, Ken Spencer wrote: I am trying to make a function for my extension that makes a predefined variable global I have tried something along the lines of: if(zend_hash_find(&EG(symbol_table), var, strlen(var)+1, (void **) &vars_data)!=FAILURE) { ZEND_SET_SYMBOL(EG(active_s

Re: [PHP-DEV] Making a variable global question

2003-08-01 Thread Ken Spencer
On Fri, 1 Aug 2003, Rasmus Lerdorf wrote: My apologies, my explanation wasn't very clear. my initialization function needs to both parse the argument stack, but it also declars a few user defined variables to be global. I did not include the portion of code in my snippet that ensures the func

Re: [PHP-DEV] Making a variable global question

2003-08-01 Thread Rasmus Lerdorf
Your code doesn't make much sense to me. This is your code, right? if(zend_hash_find(&EG(symbol_table), var, strlen(var)+1, (void **)&vars_data)!=FAILURE) { ZEND_SET_SYMBOL(EG(active_symbol_table), var, *vars_data); } So you look for a global variable named whatever the contents of

Re: [PHP-DEV] Making a variable global question

2003-08-01 Thread Ken Spencer
On Fri, 1 Aug 2003, Mark Spruiell wrote: Mark, thanks for your reply. The situation is, is that I am writing a large piece of software with several hundred functions. At the beginning of each function I have som initialization code that allows me to do several thing. Parse through the variab

Re: [PHP-DEV] Making a variable global question

2003-08-01 Thread Mark Spruiell
Hi Ken, I'm fairly new to PHP extension programming, so forgive me if I'm missing the obvious, but your code appears to be trying to copy a global variable to a local scope. Is that your intent? If so, why can't the script do this itself by using a "global" declaration for the variable? For examp

[PHP-DEV] Making a variable global question

2003-07-31 Thread Ken Spencer
I am trying to make a function for my extension that makes a predefined variable global I have tried something along the lines of: if(zend_hash_find(&EG(symbol_table), var, strlen(var)+1, (void **) &vars_data)!=FAILURE) { ZEND_SET_SYMBOL(EG(active_symbol_table), var, *vars_data); }