<?php
class A {
public function printMe() {
print get_class($this).PHP_EOL;
}
}
class AB extends A {
}
class App {
public function run(A $a) {
$a->printMe();
}
}
class MyApp extends App {
public function run(AB $ab) {
parent::run($ab);
}
}
$ab = new AB();
$app = new MyApp();
$app->run($ab);
Strict Standards: Declaration of MyApp::run() should be compatible with that of App::run() in /in/cl3o5 on line 23
AB
Output for 5.0.0 - 5.0.1
Strict Standards: Declaration of MyApp::run() should be compatible with that of App::run() in /in/cl3o5 on line 23
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/cl3o5 on line 5
ABPHP_EOL
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/cl3o5 on line 4
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/cl3o5 on line 4
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/cl3o5 on line 4
Process exited with code 255.