<?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.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
- 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:
62.83 ms | 408 KiB | 5 Q