3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractService { } abstract class AbstractFactory { abstract function make(AbstractService $s); } class ConcreteService extends AbstractService { } class ConcreteFactory extends AbstractFactory { function make(ConcreteService $s) {} }
Output for 7.0.0 - 7.0.7
Fatal error: Declaration of ConcreteFactory::make(ConcreteService $s) must be compatible with AbstractFactory::make(AbstractService $s) in /in/vMJW5 on line 6
Process exited with code 255.
Output for 5.5.0 - 5.5.36, 5.6.0 - 5.6.22
Fatal error: Declaration of ConcreteFactory::make() must be compatible with AbstractFactory::make(AbstractService $s) in /in/vMJW5 on line 6
Process exited with code 255.

preferences:
205.54 ms | 1395 KiB | 74 Q