<?php
error_reporting(E_ALL & ~E_STRICT);
class A {
public function doSth(A $a) {
echo 'asd';
}
}
class B extends A {
public function doSth(B $a) {
echo 'qwe';
}
}
$a = new A();
$b = new B();
$b->doSth($b);
Strict Standards: Declaration of B::doSth() should be compatible with that of A::doSth() in /in/MaX4L on line 14
qwe
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/MaX4L 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/MaX4L 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/MaX4L on line 5
Process exited with code 255.