Forum Moderators: coopster
Class A{
function develop(){
...
if (class of $this=='B') { ...};
...
}
Class B extends Class A{
}
$obj=new B;
$obj->develop();
I think I have 3 choices here
1. Have two functions in each class with a slightly different code.
2. Get the parent of the class (as above) and code accordingly
3. Split the function into two. Retain develop in Class A, and it calls a function SpecialLine which is in both classes.(not sure how to ensure the right function is called)
Which is the best option and its solution and is there anoter way?
thanks,Shumit
See Example 3, in particular, for being able to both use, and modify, a parent class's function.