diff options
| author | Nikita Popov <nikic@php.net> | 2016-06-04 14:53:50 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2016-06-04 14:53:50 +0200 |
| commit | 9ba243b6f385a1f38f6f180d0dbf82928f15341c (patch) | |
| tree | e37f0d181590169f069f5a2607866a29de0337ae /Zend/zend_compile.c | |
| parent | 73b2f791997a254788b1939ca8cef373694f8461 (diff) | |
| download | php-git-9ba243b6f385a1f38f6f180d0dbf82928f15341c.tar.gz | |
Forbid ?void
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 2a575cff62..ce8224652d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4964,6 +4964,10 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */ zend_compile_typename(return_type_ast, arg_infos); + if (arg_infos->type_hint == IS_VOID && arg_infos->allow_null) { + zend_error_noreturn(E_COMPILE_ERROR, "Void type cannot be nullable"); + } + arg_infos++; op_array->fn_flags |= ZEND_ACC_HAS_RETURN_TYPE; } else { |
