CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 question about using global in a function..

Print topic Send  topic

Author Message
CodeChargenewbie

Posts: 114
Posted: 09/28/2007, 9:15 AM

I have no idea how to sum up what I'm trying to say; so, sorry about the title

Here's the line of code in a function that I'm concerned about.

function test()
{

code...

global $var->something("Text " . $var2, $var3, $var4);

more code...

}


I got some t_object_operator error with the line, complaining about a comma or semicolon. Is said line possible?

See, instead of doing this:

function test()
{

global $var;
global $var2;
global $var3;
global $var4;

code...

$var->something("Text " . $var2, $var3, $var4);

more code...

}


I'd rather do the line in question and eliminate the overhead. I know, I could pass in the variables as arguments and such, but I was curious if the line above can work.

Thank you.
View profile  Send private message
wkempees
Posted: 09/28/2007, 3:30 PM

Cannot be done like this, there is NO overhad.
Your desired solution looks more like array passing.
But that is a different subject altogether.
Walter



Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.