PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm coding an ecommerce package and I have an array, $store_info, that I use EVERYWHERE. I'm tired of declaring it to be global, and there aren't any associated functions so there's no use in creating an object for it.
Is there a command I can use to promote this variable to a superglobal like $_SESSION or $_REQUEST?
I guess, whether with good reason or not, I've always tried to keep my session variables as un-cluttered (read: small / limited) as possible. Is this such a fast operation in PHP that I shouldn't worry about it?
the only real performance hit with sessions is unserialization, extraction and storage. Once it's in PHP, it doesn't matter much, it's just a variable.
Sessions are used everywhere... they're nothing fancy. OK, if you're digging an old session back up fro the database or filesystem then there will be some overhead there but that's a one-off. You should see some of the session stuff we have on our pages at work .