here is some php code:
class A {
private function action(){
echo 1;
}
public static function callAction(A $a){
$a->action();
}
}
$a = new A;
A::callAction($a);
can someone explain me why does object method is vissible from static method context how does following code works in other languages ???
The keyword
privatemeans the function is accessible from within this class only, not from within this object. The behaviour is the same in all languages I know.