<?php
interface MyInterface {
public function execute($arg1, $arg2);
}
trait MyTrait {
public function execute() {
echo 'Not this';
}
}
class MyClass implements MyInterface {
use MyTrait {
execute as protected commanderExecute;
}
public function execute($arg1, $arg2)
{
echo 'Hello';
}
}
(new MyClass)->execute();
Fatal error: Uncaught ArgumentCountError: Too few arguments to function MyClass::execute(), 0 passed in /in/c1ie7 on line 29 and exactly 2 expected in /in/c1ie7:21
Stack trace:
#0 /in/c1ie7(29): MyClass->execute()
#1 {main}
thrown in /in/c1ie7 on line 21
Process exited with code 255.
Warning: Missing argument 1 for MyClass::execute(), called in /in/c1ie7 on line 29 and defined in /in/c1ie7 on line 21
Warning: Missing argument 2 for MyClass::execute(), called in /in/c1ie7 on line 29 and defined in /in/c1ie7 on line 21
Hello