Professional Documents
Culture Documents
Exercise 1
Exercise 1
Time to try out declaring classes and making objects for yourself.
• Create a User class
• Instantiate the class and var_dump() it
Check that the output looks as you would expect. You can run PHP from the commandline like in
the screencasts, or just output to your browser.
<?php
$cat->title = "Sir";
$cat->name = "Fluffiness";
Check out the example solution in exercise1-by-example.php to see one way to achieve this.