mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
330cc5cdb2
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types Co-authored-by: Gina Peter Banyard <girgias@php.net>
19 lines
407 B
PHP
19 lines
407 B
PHP
--TEST--
|
|
Bug #72119 (Interface declaration compatibility regression with default values)
|
|
--FILE--
|
|
<?php
|
|
interface Foo {
|
|
public function bar(?array $baz = null);
|
|
}
|
|
|
|
class Hello implements Foo {
|
|
public function bar(array $baz = [])
|
|
{
|
|
|
|
}
|
|
}
|
|
echo "OK\n";
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Declaration of Hello::bar(array $baz = []) must be compatible with Foo::bar(?array $baz = null) in %s on line %d
|