3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Calculation { } class TravelCalculation extends Calculation { } class Service { public function run(Calculation $c) { echo "Service calculation"; } } 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.3.0 - 5.4.24
Parse error: syntax error, unexpected ')', expecting ',' or ';' in /in/3SSst on line 18
Process exited with code 255.