3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface A { public function setData(); } class B implements A{ public function setData(User $user) {} } class C implements A{ public function setData(Customer $customer) {} }
based on bZYol
Output for 7.0.0 - 7.3.0rc3
Fatal error: Declaration of B::setData(User $user) must be compatible with A::setData() in /in/X8mlc on line 7
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Declaration of B::setData() must be compatible with that of A::setData() in /in/X8mlc:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Declaration of B::setData() must be compatible with A::setData() in /in/X8mlc on line 7
Process exited with code 255.