|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-11 23:32 UTC] andrey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
Description: ------------ If offset + length > MAX_INTEGER then array_slice function returns wrong results (obviously overflows soume integer in its implementation). Reproduce code: --------------- $a = array(0,1,2,3,4,5); // this is ok: print_r(array_slice($a,2,2147483645)); // this is wrong: print_r(array_slice($a,2,2147483646)); Expected result: ---------------- Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 ) Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 ) Actual result: -------------- Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 ) Array ( )