Re: Variable scope
Posted: Wed May 19, 2010 2:50 pm
I agree. This will only lead to difficult bugs and maintenance nightmares. You should only pass exactly and explicitly what the function needs to process.AbraCadaver wrote:You can do this, however I would recommend one of the other solutions:larrygingras wrote:Unfortunately, no. It seems that it is not permitted to use function for default argument value: PHP Parse error: syntax error, unexpected '(', expecting ')' in /cd/home/admin/test.php on line 2
If the variables are global, then you can just use the $GLOBALS array in the safe_query() function.Code: Select all
safe_query('query', get_defined_vars());