Bug #62903 [Opn]: array_slice ignores preserve_keys with no length

From: Date: Thu, 23 Aug 2012 06:52:26 +0000
Subject: Bug #62903 [Opn]: array_slice ignores preserve_keys with no length
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172817@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62903&edit=1 ID: 62903 User updated by: php at nobswolf dot info Reported by: php at nobswolf dot info Summary: array_slice ignores preserve_keys with no length Status: Open Type: Bug Package: Arrays related Operating System: windows PHP Version: 5.3.16 Block user comment: N Private report: N New Comment: no its not... the problem is a later array_merge, which does not have the option of preserve_keys my fault, sorry maybe every "reorder"-function should have this option Previous Comments: ------------------------------------------------------------------------ [2012-08-23 06:18:54] php at nobswolf dot info Description: ------------ I want to slice an array into a first one with the first 3 entries and a second one with the rest (variable length). Test script: --------------- $wertA2 = array_slice ($wertA, 0, 3, true); $wertA3 = array_slice ($wertA, 3, null, true); Expected result: ---------------- I need preserved keys even when I can not give a length. Actual result: -------------- The preserve_keys = true gets ignored and keys a get renumbered :-( see also #41686 This bug is 5 years old. When will it get fixed? ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62903&edit=1

« previous php.bugs (#172817) next »