summaryrefslogtreecommitdiff
path: root/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt
blob: a04cd84f5ea44a4efef41957386350ba8c447015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--TEST--
Additional optional parameters must have a matching prototype
--FILE--
<?php

interface DB {
    public function query($query, string ...$params);
}

class MySQL implements DB {
    public function query($query, int $extraParam = null, string ...$params) { }
}

?>
--EXPECTF--
Fatal error: Declaration of MySQL::query($query, ?int $extraParam = null, string ...$params) must be compatible with DB::query($query, string ...$params) in %s on line %d