3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { protected $message = 'breaks'; public function __construct() { } public function getMessage($type) { return $this->message; } } class B extends A { public function __construct($message) { parent::__construct(); $this->message = $message; } public function getMessage() { return $this->message; } } $o = new B('works'); echo $o->getMessage() . PHP_EOL;
based on EUjMR
Output for 7.0.0 - 7.2.0
Warning: Declaration of B::getMessage() should be compatible with A::getMessage($type) in /in/qvITi on line 24 works
Output for 5.4.10 - 5.6.28
Strict Standards: Declaration of B::getMessage() should be compatible with A::getMessage($type) in /in/qvITi on line 24 works
Output for 5.3.20 - 5.3.29
Strict Standards: Declaration of B::getMessage() should be compatible with that of A::getMessage() in /in/qvITi on line 24 works