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.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1 - 8.4.2
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:
93.37 ms | 409 KiB | 5 Q