sangoku Posted February 25, 2010 Share Posted February 25, 2010 Ok i have a instantiation file. there i declare the standart variables ike db, username, some values .... bla bla NOW my question from performance point of view what is faster to declare and use a static variable or a normal variable???? Quote Link to comment https://forums.phpfreaks.com/topic/193393-static-or-var-whats-betehr/ Share on other sites More sharing options...
zeodragonzord Posted March 15, 2010 Share Posted March 15, 2010 I don't know about the performance aspect, but unless you're initalizing over 1million variables, the think the performance is negligible. What's more important is how you're going to use it. You say static variables, do you mean constants or do you mean static variables inside a class? The question is, should these values ever change? In an application, the database username/password should not change (your code should not have the ability to change it once it's set), so that should remain a constant. Think of it like that. Quote Link to comment https://forums.phpfreaks.com/topic/193393-static-or-var-whats-betehr/#findComment-1026503 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.