|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-12-14 14:52 UTC] robin_fernandes at uk dot ibm dot com
Description: ------------ With php5.2.x, explicitly specifying an argument of length 0 would result in an array of length 0. However, with the snaps for php5.3 and php6.0, the length argument is ignored if it is 0. This may have been introduced by the patch for bug 43541, which fixed the type conversion for this parameter. Note that testcase ext/standard/tests/array/array_slice.phpt is affected by this change. Expected output below is taken from php5.2.5. Reproduce code: --------------- <?php $a = array(1,2,3,4); var_dump(array_slice($a, 1, 0)); ?> Expected result: ---------------- array(0) { } Actual result: -------------- array(3) { [0]=> int(2) [1]=> int(3) [2]=> int(4) } PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 08:00:01 2025 UTC |
In PHP 5.3.0-dev (cli) (built: Dec 11 2007 13:57:26) returns: array(0) { }I have tried with 5.2.5 and actual result is: array(0) { }Hi msaraujo, thanks for looking at this. Just to ensure there is no confusion: the purpose of this report is to notify of a change in behaviour at least in the php 5.3 / 6.0 snaps. We agree that php 5.2.5 outputs array(0) { }, and I believe that is the correct output.