<?php
class A {
private function m1() {
echo 'AHAHHA';
}
}
class B extends A {
public function m2() {
$this->m1();
}
private function m1() {
parent::m1();
}
}
$b = new B();
$b->m2();
Fatal error: Uncaught Error: Call to private method A::m1() from scope B in /in/AsAtL:18
Stack trace:
#0 /in/AsAtL(14): B->m1()
#1 /in/AsAtL(23): B->m2()
#2 {main}
thrown in /in/AsAtL on line 18
Process exited with code 255.
Fatal error: Uncaught Error: Call to private method A::m1() from context 'B' in /in/AsAtL:18
Stack trace:
#0 /in/AsAtL(14): B->m1()
#1 /in/AsAtL(23): B->m2()
#2 {main}
thrown in /in/AsAtL on line 18
Process exited with code 255.
Fatal error: Call to private method A::m1() from context 'B' in /in/AsAtL on line 18
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/AsAtL on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/AsAtL on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/AsAtL on line 5
Process exited with code 255.