From a1527fdaf3226a676648d19807d59808a6d61b9a Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sat, 15 Oct 2005 12:54:19 +0000 Subject: [PATCH] - Changed type hints so that they take "= NULL" as default value. --- NEWS | 2 ++ Zend/zend_compile.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index dc80e70ba4..788911f11d 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 6.0 - Unicode support. (Andrei, Dmitriy, et al) +- Changed type hints so that they take "= NULL" as default value. (Marcus, + Derick) - Changed __toString() behavior to call it in all necessary places (Marcus, Dmitry) - Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 90a8253f3a..cae7f11c13 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1337,7 +1337,7 @@ void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initia cur_arg_info->class_name = NULL; cur_arg_info->class_name_len = 0; } - cur_arg_info->allow_null = 0; + cur_arg_info->allow_null = (op == ZEND_RECV_INIT && (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")))) ? 1 : 0; } else { cur_arg_info->class_name = NULL; cur_arg_info->class_name_len = 0; -- 2.40.0