summaryrefslogtreecommitdiff
path: root/Zend/tests/variadic/removing_parameter_error.phpt
blob: cf483c7feceeffe972069b8739039b0d8c427cc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
It's not possible to remove required parameter before a variadic parameter
--FILE--
<?php

/* Theoretically this should be valid because it weakens the constraint, but
 * PHP does not allow this (for non-variadics), so I'm not allowing it here, too,
 * to stay consistent. */

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

class MySQL implements DB {
    public function query(...$params) { }
}

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