Jump to content

static or $var whats betehr


sangoku

Recommended Posts

  • 3 weeks later...

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.