- Output for 8.0.1 - 8.0.26, 8.1.0 - 8.1.13, 8.2.0
- Fatal error: Declaration of ChildClass::myMethod($foo) must be compatible with MyClass::myMethod($foo, ...$args) in /in/rEU6t on line 14
Process exited with code 255.
<?php
class MyClass {
public function myMethod($foo, ...$args) {
print $foo;
print_r($args);
}
}
$myClass = new MyClass();
$myClass->myMethod("Hi", "here", "are","some", "args");
class ChildClass extends MyClass {
public function myMethod($foo) {
print $foo;
}
}