diff options
Diffstat (limited to 'Zend/tests/variadic/removing_parameter_error.phpt')
| -rw-r--r-- | Zend/tests/variadic/removing_parameter_error.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/tests/variadic/removing_parameter_error.phpt b/Zend/tests/variadic/removing_parameter_error.phpt new file mode 100644 index 0000000000..a189e5cf09 --- /dev/null +++ b/Zend/tests/variadic/removing_parameter_error.phpt @@ -0,0 +1,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() must be compatible with DB::query($query, ...$params) in %s on line %d |
