class subclass_name : access_mode base_class_name { //body of subclass }; Here, subclass_name is the name of the sub class, access_mode is the mode in which you want to inherit this sub class for example: public, private etc. Parent is a keyword which we use to access members of a parent class. Now let us see types of inheritance supported in Object Oriented Programming and corresponding Php inheritance examples. Inheritance concept allows programmers to define a class in terms of another class, which makes creating and maintaining application easier. Online C++ inheritance programs and examples with solutions, explanation and output for computer science and information technology students pursuing BE, BTech, MCA, MTech, MCS, MSc, BCA, BSc. When I heard that multiple inheritance was not allowed, I was confused, because I thought that class B could extend class A and that was it. Types of PHP Inheritance. - PHP uses the concept of inheritance only in the object model. Example of Single Inheritance in C++ The mapping information are kept on the uppermost superclass, so if it comes from a vendor package and you subclass it you can't modify the mapping metadata. Code: