summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-04-06 18:24:34 +0300
committerLevi Morrison <levim@php.net>2016-05-05 09:34:16 -0600
commit49fe737e585d2bf3cea4df14ef7a1965dc632655 (patch)
treeb1ed13c418e548f56f8f9f7c4eee9764a1fe1ae3 /Zend/zend_compile.c
parent59f35c0ca9abfa72c5393f6c0350759a3f6512d8 (diff)
downloadphp-git-49fe737e585d2bf3cea4df14ef7a1965dc632655.tar.gz
Implement nullable return types.
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 50bcb3b7ad..fe81aadcf8 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -4906,6 +4906,11 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
arg_infos->allow_null = 0;
arg_infos->class_name = NULL;
+ if (return_type_ast->attr & ZEND_TYPE_NULLABLE) {
+ arg_infos->allow_null = 1;
+ return_type_ast->attr &= ~ZEND_TYPE_NULLABLE;
+ }
+
zend_compile_typename(return_type_ast, arg_infos);
arg_infos++;