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

index 8e0024eae4918d1b15363a15c8bfc12513b57932..3e69d9573ad98ce09efeccfb3912d3c2e838261b 100644 (file)
@@ -2111,7 +2111,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) {