Re: Bug#28151 Writing to Uninitialized Arrays

From: Date: Mon, 26 Apr 2004 08:35:51 +0000
Subject: Re: Bug#28151 Writing to Uninitialized Arrays
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-9565@lists.php.net to get a copy of this message
PHP has always allowed defining arrays on demand. This would break many scripts and I don't see any reason to force people to define variables as arrays, especially when these variables are undefined. Andi At 10:18 PM 4/25/2004 -0700, Sara Golemon wrote:
Here's what I think is the fix for 28151 (I have no strong feelings on whether or not it belongs in the engine, but I am +1 on it personally). Zend guys? Index: Zend/zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.643 diff -u -r1.643 zend_execute.c
--- Zend/zend_execute.c 15 Apr 2004 21:32:34 -0000      1.643
+++ Zend/zend_execute.c 26 Apr 2004 05:06:59 -0000 @@ -919,6 +919,7 @@
                                        SEPARATE_ZVAL(container_ptr);
                                        container = *container_ptr;
                                }
+                               zend_error(E_NOTICE, "Uninitialized array");
                                array_init(container);
                                break;
                }
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.internals (#9565) next »