What is the difference between static variable and a constant?
Answer:
You can change the value of a static variable, you can't with constants.
class Foo {
public static $counter = 1;
const SomeConstant = 10;
}
Foo::$counter++;
echo Foo::$counter; // This should give us '2'
echo Foo::SomeConstant; // This should give us '10'
Foo::SomeConstant++; // Error. Cannot change the value of a constant.
