3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Walker { function walk( $elements, $max_depth, ...$args ) { echo 1; } } class My_Walker extends Walker { function walk( $elements, $max_depth ) { echo 2; } } $a = new My_Walker(); $a->walk( 1, 2 );
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Declaration of My_Walker::walk($elements, $max_depth) must be compatible with Walker::walk($elements, $max_depth, ...$args) in /in/2iS9g on line 10
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Declaration of My_Walker::walk($elements, $max_depth) should be compatible with Walker::walk($elements, $max_depth, ...$args) in /in/2iS9g on line 10 2
Output for 7.1.25 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Warning: Declaration of My_Walker::walk($elements, $max_depth) should be compatible with Walker::walk($elements, $max_depth, ...$args) in /in/2iS9g on line 13 2

preferences:
158.76 ms | 402 KiB | 164 Q