I am surprised for why the constructor is called when we have different class and constructor name. Constructor name is starting with small "r"?
class Registration{
function registration(){
echo "Constructor is called.";
}
}
$obj = new Registration();
//$obj->registration();
Outputs:
Constructor is called.
Modification:
Does this case-insensitive behavior depends on php versions we are using?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…