<?php
interface TestInterface {
public function foo();
}
class Test implements TestInterface {
public function foo(...$extraArgs) {
var_dump(extraArgs);
}
}
$obj = new Test;
$obj->foo(1, null, [1], 'a');
Fatal error: Uncaught Error: Undefined constant "extraArgs" in /in/2JLja:9
Stack trace:
#0 /in/2JLja(15): Test->foo(1, NULL, Array, 'a')
#1 {main}
thrown in /in/2JLja on line 9
Process exited with code 255.
Warning: Use of undefined constant extraArgs - assumed 'extraArgs' (this will throw an Error in a future version of PHP) in /in/2JLja on line 9
string(9) "extraArgs"