diff options
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r-- | Zend/zend_compile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 309f7005d2..d44417a178 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -162,6 +162,7 @@ static const struct reserved_class_name reserved_class_names[] = { {ZEND_STRL("true")}, {ZEND_STRL("void")}, {ZEND_STRL("iterable")}, + {ZEND_STRL("object")}, {NULL, 0} }; @@ -207,6 +208,7 @@ static const builtin_type_info builtin_types[] = { {ZEND_STRL("bool"), _IS_BOOL}, {ZEND_STRL("void"), IS_VOID}, {ZEND_STRL("iterable"), IS_ITERABLE}, + {ZEND_STRL("object"), IS_OBJECT}, {NULL, 0, IS_UNDEF} }; @@ -5565,6 +5567,12 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */ "with iterable type can only be an array or NULL"); } break; + + case IS_OBJECT: + zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters " + "with a %s type can only be NULL", + zend_get_type_by_const(ZEND_TYPE_CODE(arg_info->type)), zend_get_type_by_const(ZEND_TYPE_CODE(arg_info->type))); + break; default: if (!ZEND_SAME_FAKE_TYPE(ZEND_TYPE_CODE(arg_info->type), Z_TYPE(default_node.u.constant))) { |