Topic: static or non-static funtions?
I'm new to OOP PHP. I have learn OOP, but with Java. The basics are the same but some things are different.
I see that Jon uses static methods in his examples and Doctrine have some as well. What I am wondering about is which functions should be static and which should not? Should most of them be non-static? What are the best practices and/or the theory behind it?
I have an example:
In my User class extending BaseUser (we are talking Doctrine here). When I'm making a function to get a spesific user by id, what would be the best here? static or not?
I guess i need to understand in which situation to use static functions and which not to use them.
I realise that this is not php spesific, but I haven't encountered this question the little time I have used java.
Last edited by harri (2010-06-03 16:31:19)