FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » static vs global variable
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: static vs global variable [message #172709 is a reply to message #172698] Sun, 27 February 2011 01:42 Go to previous messageGo to previous message
Leonardo Azpurua is currently offline  Leonardo Azpurua
Messages: 46
Registered: December 2010
Karma:
Member
"The Natural Philosopher" <tnp(at)invalid(dot)invalid> escribió en el mensaje
news:ikb2fq$o8f$1(at)news(dot)albasani(dot)net...
>
> That's maybe possible if you are writing OO code, but it is often
> simpler when having functions that modify several different
> variables, to have then as globals, in order not to either pass
> pointers to the functions, or try and work out a way to return more
> than one variable from a function.

Hi,

Perhaps I have become thick with the years, but I can't imagine why a
function should be required to modify several different global
variables.

If you don't want to enter into all the details and subtleties of OOP,
fine. But using and object to pack all the data required by a given
process, and pass it to any function that might need it is even easier
than having to remember the names of every global variable involved in
a complex procedure.

I am completely new to PHP, but it is universal programming common
sense, like using structs in C, or Records in Pascal.

--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: ODBC Connection
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 22:01:46 GMT 2024

Total time taken to generate the page: 0.03726 seconds