3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class Scope { } class ApplicationScope extends Scope { /** * * @param array $args configuration files or params that can affect * application. */ public function __construct(array $args) { $this->args = $args; } public function getArgs() { return $this->args; } } class TradeScope extends Scope { private $tradeFields; function __construct(array $tradeFields) { $this->tradeFields = $tradeFields; } } abstract class ScopeEntrance { abstract public function get(Scope $scope); } class TradeScopeEntrance extends ScopeEntrance { public function __construct($applicationScope) { } public function get(TradeScope $tradeScope) { } } $applicationScope = new ApplicationScope("arg1"); $tradeScopeEntrance = new TradeScopeEntrance($applicationScope); ?>
Output for 5.4.0 - 5.4.18
Fatal error: Declaration of TradeScopeEntrance::get() must be compatible with ScopeEntrance::get(Scope $scope) in /in/OgEp3 on line 46
Process exited with code 255.
Output for 5.1.0 - 5.3.27
Fatal error: Declaration of TradeScopeEntrance::get() must be compatible with that of ScopeEntrance::get() in /in/OgEp3 on line 46
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /in/OgEp3 on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/OgEp3 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_CLASS in /in/OgEp3 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OgEp3 on line 3
Process exited with code 255.