3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Calculation { } class TravelCalculation extends Calculation { } abstract class Service { abstract public function run(Calculation $c); } class TravelService extends Service { public function run(TravelCalculation $c) { echo "Travel Service calculation"; } } $calculation = new TravelCalculation(); $service = new TravelService(); $service->run($calculation);
Output for 5.4.0 - 5.4.24
Fatal error: Declaration of TravelService::run() must be compatible with Service::run(Calculation $c) in /in/XeZEO on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Fatal error: Declaration of TravelService::run() must be compatible with that of Service::run() in /in/XeZEO on line 18
Process exited with code 255.