3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function x(array $x){} } class B extends A{ function x(iterable $x){} } class A1 { function x(Iterator $x){} } class B1 extends A1{ function x(iterable $x){} }
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Warning: Declaration of B1::x(iterable $x) should be compatible with A1::x(Iterator $x) in /in/8oZtB on line 7
Output for 7.0.0 - 7.0.20
Warning: Declaration of B::x(iterable $x) should be compatible with A::x(array $x) in /in/8oZtB on line 4 Warning: Declaration of B1::x(iterable $x) should be compatible with A1::x(Iterator $x) in /in/8oZtB on line 7

preferences:
117.76 ms | 1637 KiB | 4 Q