]> granicus.if.org Git - php/commitdiff
Initialize with length instead of 0 (and thanks Antony for finding)
authorMatt Wilmas <mattwil@php.net>
Mon, 2 Jun 2008 11:20:17 +0000 (11:20 +0000)
committerMatt Wilmas <mattwil@php.net>
Mon, 2 Jun 2008 11:20:17 +0000 (11:20 +0000)
ext/standard/array.c

index f05d734f573999f86122127fc4add50f88e3b08f..ccfd772c2aa756b8f85f9eb02bf922dbad039168 100644 (file)
@@ -2298,7 +2298,7 @@ PHP_FUNCTION(array_splice)
        /* Don't create the array of removed elements if it's not going
         * to be used; e.g. only removing and/or replacing elements */
        if (return_value_used) {
-               int size = 0;
+               int size = length;
 
                /* Clamp the offset.. */
                if (offset > num_in) {