From: Felipe Pena Date: Sun, 18 May 2008 15:42:09 +0000 (+0000) Subject: - Making compatible with 64bit plataform X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~198 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d90f689d73367c2134b847030007ec55999db467;p=php - Making compatible with 64bit plataform --- diff --git a/ext/standard/array.c b/ext/standard/array.c index c66fb1677f..4f6251b91b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2163,7 +2163,7 @@ PHP_FUNCTION(array_slice) /* ..and the length */ if (length < 0) { length = num_in - offset + length; - } else if (((unsigned) offset + (unsigned) length) > (unsigned) num_in) { + } else if (((unsigned long) offset + (unsigned long) length) > (unsigned) num_in) { length = num_in - offset; } diff --git a/ext/standard/tests/array/array_slice_variation6.phpt b/ext/standard/tests/array/array_slice_variation6.phpt index e37ed46c54..e32abfcbce 100644 --- a/ext/standard/tests/array/array_slice_variation6.phpt +++ b/ext/standard/tests/array/array_slice_variation6.phpt @@ -133,10 +133,18 @@ array(4) { } -- $length is maximum integer value -- -array(0) { +array(4) { + [0]=> + string(3) "two" + [1]=> + string(5) "three" + [2]=> + string(4) "nine" + ["ten"]=> + int(10) } -- $length is minimum integer value -- array(0) { } -Done \ No newline at end of file +Done