noob to oop and starting to create php class files, i have a couple of questions:
1- When should i declare variables in the class file (i,e, varable $result)? I have written a couple of quite complex class fiels that use variables that I have not explicitly declared at the start of the class definition but seem to work quite well. Is it going to cause me problems later?
2 – To avoid complex if .. then … else statements, is it possible to use a break/exit type command to end the function (in particular a constructor) when a condition is satisfied? Currently my latest class file to integrate paypal PDT processing has 16 nested if/else statements and whilst it works I just feel it is not as efficient as it could be. All my attempts to use break/exit end the php script that is calling the class/function.
thanks
Graham