3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function aa(int $a) { echo $a; } } class B extends A { public function aa(float $a, float $b) { echo $a; } } $a = new A(); $a->aa(1);
based on qlbc9
Output for 7.0.0 - 7.2.0
Warning: Declaration of B::aa(float $a, float $b) should be compatible with A::aa(int $a) in /in/mrgBi on line 12 1
Output for 5.4.0 - 5.6.28
Strict Standards: Declaration of B::aa() should be compatible with A::aa(int $a) in /in/mrgBi on line 12 Catchable fatal error: Argument 1 passed to A::aa() must be an instance of int, integer given, called in /in/mrgBi on line 15 and defined in /in/mrgBi on line 3
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Strict Standards: Declaration of B::aa() should be compatible with that of A::aa() in /in/mrgBi on line 12 Catchable fatal error: Argument 1 passed to A::aa() must be an instance of int, integer given, called in /in/mrgBi on line 15 and defined in /in/mrgBi on line 3
Process exited with code 255.