Closed
Description
Starting from PHP5.3, classes can make interface method parameters nullable.
Code:
<?php
interface a
{
public function test($a);
}
class b implements a
{
public function test($a = null) {}
}
var_dump(new b);
Result:
-> linux
-> app:run
-> install
Fatal error: Uncaught Error: Declaration of b::test($a = null) should be compatible with a::test($a) in res://p.php on line 10, position 12
Stack Trace:
#0 {main}
thrown in res://p.php on line 10