]> granicus.if.org Git - php/commitdiff
- Changed type hints so that they take "= NULL" as default value.
authorDerick Rethans <derick@php.net>
Sat, 15 Oct 2005 12:54:19 +0000 (12:54 +0000)
committerDerick Rethans <derick@php.net>
Sat, 15 Oct 2005 12:54:19 +0000 (12:54 +0000)
NEWS
Zend/zend_compile.c

diff --git a/NEWS b/NEWS
index dc80e70ba47d4eb010a0be101dd10915e7034336..788911f11d1fab233a20eae46cd083af993f02d3 100644 (file)
--- 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()
index 90a8253f3a27f8fe821559d21a6fa0982b9b6e4a..cae7f11c1336016ef02fb771049713cd6efd9888 100644 (file)
@@ -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;