Hello everybody, i am here with one doubt in my mind,
if we have a class in php with protected or private properties , we can access them with help of a public method, how is it possibile to access a private or protected method??? *
@GLOBALS - can u please explain how to call a private method within class ?
As we can access the properties by another public method as u wrote, but how if we have a private method?
for ex:
class Person{
private $name;
private $age;
private function __construct($name, $age){
}
}
P.S: I am not thinking about a child class. Even not sure if i wrote the example in right manner. Hope u understand what i mean to say.
Thanks