3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class A { protected $a; protected $b; abstract public function __construct($a); } class B extends A { public function __construct($a) { $this->a = $a; } } class C extends A { public function __construct($a, $b) { $this->a = $a; $this->b = $b; } } $b = new B(1); $c = new C(1, 2);
Output for 5.4.0 - 5.4.16
Fatal error: Declaration of C::__construct() must be compatible with A::__construct($a) in /in/42d1K on line 28
Process exited with code 255.
Output for 5.3.0 - 5.3.29