inheritance concept in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sandip1992
Forum Newbie
Posts: 1
Joined: Wed Jul 04, 2012 1:35 am

inheritance concept in php

Post by sandip1992 »

Hi, i am bit confused of inheritance concept in php and would also like to learn CURL library. Pls help me with some

example to understand the concept. I faced this problem while taking PHP training. I have tried learning CURL library, but it is very confusing. If i can get some sample code with

explaination, will be a great help. Thanks in Advance.

--
--
Regards,
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: inheritance concept in php

Post by social_experiment »

Inheritance in php is similar to inheritance in humans, if you create a class (say Class A) and extend it with another class (Class B) then Class A's properties and methods (unless properties & methods are declared as private i think) will be accessible to class B;
http://www.php.net/manual/en/language.o ... itance.php
More about inheritance in php5.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply