Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Extending Object-Oriented PHP!
You have completed Extending Object-Oriented PHP!
Preview
When using multiple classes, there are several functions in PHP that will allow us to learn about those classes.
Documentation
- get_class() - Returns the name of the class of an object
- is_a() - Checks if the object is of this class or has this class as one of its parents
- get_object_vars() - Gets the properties of the given object
You could also try some additional class/object functions
- get_class_methods() - Gets the class methods' names
- get_class_vars() - Get the default properties of the class
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Open index.php.
We'll start by adding a var_dump of
0:00
the listings within the foreach loop.
0:03
Let's preview this in the browser.
0:11
Lets view the page source,
and increase the font size.
0:16
This shows us that the object itself
is a listing premium object, but
0:20
its variables are taken from
the listing basics class.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up