What's the difference between these object callings?
Non Static:
$var = new Object;
$var->function();
Static:
$var = User::function();
And also inside a class
why should I use the static property for functions?
example:
static public function doSomething(){
...code...
}
Static functions, by definition, cannot and do not depend on any instance properties of the class. That is, they do not require an instance of the class to execute (and so can be executed as you've shown without first creating an instance). In some sense, this means that the function doesn't (and will never need to) depend on members or methods (public or private) of the class.