In a general php technical interview, they will ask basic OOP questions like follows, where a high skilled programmer also might get confused sometimes, if he does not know the basics.
class a{
function a(){
echo ‘aaaa’;
}
}
class b extends a{
function b(){
echo ‘bbbb’;
parent::a();
}
}
new b;
The basic idea what we have to identify in this code snippet is, whether the function names work as constructors or not?
Yes, first it will call the function b and then it will call the function a. Which will out put,
bbbbaaaa

