To eliminate the unnecessary redeclaration of these attributes within each subclass, the subclass instead inherits the characteristics by a concept known as, conveniently enough, inheritance. Another reason to use inheritance would be to further organize data structures into strictly meaningful entities. By this I mean that only the information that is relevant to that category will be included, and nothing else. Let's go ahead and create the land , air , and water subclasses. As stated, we want the three children to share the same attributes as possessed by the Vehicle class, in addition to owning their own characteristics specific to each individual purpose.
Anchor is up.
Unfortunately, PHP does not yet support this feature. Now you've got some the basic concepts of object-oriented programming under your belt, illustrated with examples of PHP's OOP implementation syntax. Next time, we'll build upon this foundation, introducing several more of the more advanced notions of OOP design. In the meantime, take some time to experiment further with the OOP strategy. One Wicked Site Admin Combo shows how to combine PHP with MySQL for some powerful, interactive results.