3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { } class B { public function m(A $a = NULL, &$n) { echo "B.m";} }; class C extends B { public function m( $a ) { echo "C.m";} }; $b = new B(); $b->m(new A(), $b); $c = new C(); $c->m(new A(), $b); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Declaration of C::m($a) must be compatible with B::m(?A $a, &$n) in /in/Sgf7O on line 4
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Declaration of C::m($a) should be compatible with B::m(?A $a, &$n) in /in/Sgf7O on line 4 B.mC.m
Output for 7.0.6 - 7.0.33
Warning: Declaration of C::m($a) should be compatible with B::m(A $a = NULL, &$n) in /in/Sgf7O on line 4 B.mC.m
Output for 7.0.0 - 7.0.5
Warning: Declaration of C::m($a) should be compatible with B::m(A $a, &$n) in /in/Sgf7O on line 4 B.mC.m
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Strict Standards: Declaration of C::m() should be compatible with B::m(A $a, &$n) in /in/Sgf7O on line 4 B.mC.m

preferences:
224.35 ms | 402 KiB | 330 Q