3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Model {} class SubModel extends Model {} interface Loggable { public function log(Model $e); } class QMSLogger implements Loggable { public function log(SubModel $e) { echo "Foo"; } } $foo = new QMSLogger(); $foo->log(new SubModel());
based on lUclv
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of QMSLogger::log(SubModel $e) must be compatible with Loggable::log(Model $e) in /in/7eMVu on line 10
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Declaration of QMSLogger::log() must be compatible with Loggable::log(Model $e) in /in/7eMVu on line 11
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Fatal error: Declaration of QMSLogger::log() must be compatible with that of Loggable::log() in /in/7eMVu on line 11
Process exited with code 255.