PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
In second case $testvar is just undeclared. In PHP you don't have to declare your class variables, but its a good practice:
- you have a clear list of your variables
- you can set visibility (public/private)
- you can add PHPDOC description of this variable