Why there is a var function when we create classes??
I tried to use a variable with out type var before it and it worked
The "var" prefix was used in PHP 4. In PHP 5, you don't need to use the word "var" to declare a variable. In PHP 5, however, a warning will be generated if error handling is set to E_STRICT.
So does that means that it will be a problem if we dont declare it.
In PHP 5, however, a warning will be generated if error handling is set to E_STRICT.
I think he answered your question before you asked it.
Declaring 'variable' properties with var in classes is good practice. Can't understand why you wouldn't want to.
Is VAR a function in PHP??
Is it used in a place other than the classes??
var is used to declare a variable property within a class.
I haven't seen them used for php anywhere else.
It's certainly NOT a function AFAIK.
var or similar (e.g. 'dim') is used to declare variables in many languages, but procedural php doesn't require this keyword.