This forum is now read-only. Please use our new forums at

Objects in PHP Forum

View Course » View Exercise

261 points
Submitted by
about 3 years ago

Need Help with objects and Classes!

Can Someone please make me understand on Objects and classes!I'm really confused :'(

1 vote


A class is the blueprint for building objects. Objects are then made from following what instructions are provided by the class.

Think of an object as a vehicle. Not all vehicles are the same. There are trucks, cars, motorcycles, etc. However they are all vehicles.

When you create a class for vehicles you give it different properties such as the size, number of wheels, speed, etc..

After you have created the framework for the class you can create new 'instances' of it aka an object. When you create a new instance of the vehicle class you are creating a new object. With each object you can then specify the different properties that are included in the class.

For example you may have an object representing a motorcycle with a numOfWheels field set to two. You might have another object representing a car where numOfWheels is equal to 4.

This is the most basic explanation I could give. Not sure where you are at in the lessons or if you have looked into it anywhere else. Objects will be very important so definitely make sure that you have a solid understanding of them.

576 points
Submitted by
Nick Wasik
about 3 years ago