From dd70c39556fe6efe2e1f28cecf8fc73d9588d04a Mon Sep 17 00:00:00 2001 From: Joe Watkins Date: Tue, 29 Mar 2016 09:57:51 +0100 Subject: [PATCH] fix bug #71428: Validation type inheritance with = NULL --- Zend/tests/bug71428.3.phpt | 11 +++++++++++ Zend/zend_inheritance.c | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 Zend/tests/bug71428.3.phpt diff --git a/Zend/tests/bug71428.3.phpt b/Zend/tests/bug71428.3.phpt new file mode 100644 index 00000000000..2f400e5952e --- /dev/null +++ b/Zend/tests/bug71428.3.phpt @@ -0,0 +1,11 @@ +--TEST-- +bug #71428: Validation type inheritance with = NULL +--FILE-- + +--EXPECTF-- +Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(A $a = NULL, $n) in %sbug71428.3.php on line 4 + diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index b52f45487cb..1ea38a16af9 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -488,6 +488,8 @@ static ZEND_COLD zend_string *zend_get_function_declaration(const zend_function } else { smart_str_appends(&str, "NULL"); } + } else if (arg_info->type_hint && arg_info->allow_null) { + smart_str_appends(&str, " = NULL"); } if (++i < num_args) {