From 0c80cb164fc4378c7b1c9768cae63946c693e734 Mon Sep 17 00:00:00 2001 From: Levi Morrison Date: Sun, 8 Apr 2018 12:19:14 -0600 Subject: [PATCH] Fix bug #76198 --- NEWS | 1 + Zend/tests/typehints/bug76198.phpt | 13 +++++++++++++ Zend/tests/typehints/fully_qualified_scalar.phpt | 2 +- Zend/tests/typehints/namespace_relative_scalar.phpt | 2 +- Zend/zend_compile.c | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 Zend/tests/typehints/bug76198.phpt diff --git a/NEWS b/NEWS index 7774a7f7b9..dc64c78833 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,7 @@ PHP NEWS float). (Nikita) . Fixed bug #75765 (Fatal error instead of Error exception when base class is not found). (Timur Ibragimov) + . Fixed bug #76198 (Wording: "iterable" is not a scalar type). (Levi Morrison) - BCMath: . Fixed bug #66364 (BCMath bcmul ignores scale parameter). (cmb) diff --git a/Zend/tests/typehints/bug76198.phpt b/Zend/tests/typehints/bug76198.phpt new file mode 100644 index 0000000000..fcaefbbec3 --- /dev/null +++ b/Zend/tests/typehints/bug76198.phpt @@ -0,0 +1,13 @@ +--TEST-- +"iterable" must not be fully qualified +--FILE-- + +--EXPECTF-- +Fatal error: Type declaration 'iterable' must be unqualified in %s on line %d diff --git a/Zend/tests/typehints/fully_qualified_scalar.phpt b/Zend/tests/typehints/fully_qualified_scalar.phpt index d780b44dcd..84c9dee636 100644 --- a/Zend/tests/typehints/fully_qualified_scalar.phpt +++ b/Zend/tests/typehints/fully_qualified_scalar.phpt @@ -10,4 +10,4 @@ foo(1); ?> --EXPECTF-- -Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d +Fatal error: Type declaration 'int' must be unqualified in %s on line %d diff --git a/Zend/tests/typehints/namespace_relative_scalar.phpt b/Zend/tests/typehints/namespace_relative_scalar.phpt index 1bc91788cc..096d047387 100644 --- a/Zend/tests/typehints/namespace_relative_scalar.phpt +++ b/Zend/tests/typehints/namespace_relative_scalar.phpt @@ -8,4 +8,4 @@ test(0); ?> --EXPECTF-- -Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d +Fatal error: Type declaration 'int' must be unqualified in %s on line %d diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 325981e71e..3517bc188f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5419,7 +5419,7 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info, zend_b if (type != 0) { if ((ast->attr & ZEND_NAME_NOT_FQ) != ZEND_NAME_NOT_FQ) { zend_error_noreturn(E_COMPILE_ERROR, - "Scalar type declaration '%s' must be unqualified", + "Type declaration '%s' must be unqualified", ZSTR_VAL(zend_string_tolower(class_name))); } arg_info->type = ZEND_TYPE_ENCODE(type, allow_null); -- 2.40.0