3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Pager { public function fetch($page = 0, ...$categories); } class DbPager implements Pager { public function fetch($seite = 0, ...$kategorien) { var_dump($kategorien); } } $dbPager = new DbPager(); $dbPager->fetch(page: 1, categories: 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.15, 8.4.1 - 8.4.2
array(2) { ["page"]=> int(1) ["categories"]=> int(2) }
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Parse error: syntax error, unexpected ':', expecting ')' in /in/MhJ79 on line 17
Process exited with code 255.
Output for 7.2.0 - 7.2.34
Parse error: syntax error, unexpected ':', expecting ',' or ')' in /in/MhJ79 on line 17
Process exited with code 255.

preferences:
73.1 ms | 408 KiB | 5 Q