3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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);
Output for 7.0.0 - 7.3.1
Warning: Declaration of MyApp::run(AB $ab) should be compatible with App::run(A $a) in /in/cl3o5 on line 23 AB
Output for 5.4.0 - 5.6.28
Strict Standards: Declaration of MyApp::run() should be compatible with App::run(A $a) in /in/cl3o5 on line 23 AB
Output for 5.0.2 - 5.3.29
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.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
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.