3v4l.org

run code in 300+ PHP versions simultaneously
<?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.1.6, 5.2.0 - 5.2.17, 5.3.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.3.11, 4.4.0 - 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.

preferences:
206.53 ms | 1399 KiB | 107 Q