3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private function testPrivate (bool $str) { echo "Class A\n"; } public function test() { $this->testPrivate(true); } } class B extends A { private function testPrivate (string $value) { echo "Class B\n"; } } $b = new B(); $b->test();
based on jXoen
Output for 7.0.0 - 7.2.0
Class A
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to A::testPrivate() must be an instance of bool, boolean given, called in /in/ObOa4 on line 11 and defined in /in/ObOa4 on line 5
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Strict Standards: Declaration of B::testPrivate() should be compatible with that of A::testPrivate() in /in/ObOa4 on line 19 Catchable fatal error: Argument 1 passed to A::testPrivate() must be an instance of bool, boolean given, called in /in/ObOa4 on line 11 and defined in /in/ObOa4 on line 5
Process exited with code 255.