#39194 [Opn->Bgs]: array_slice feature
| From: | felipe@php.net | Date: | Mon, 18 Feb 2008 12:15:29 +0000 |
| Subject: | #39194 [Opn->Bgs]: array_slice feature | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-122400@lists.php.net to get a copy of this message | ||
ID: 39194
Updated by: felipe@php.net
Reported By: oglodek dot marek at pronox dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: linux/windows
PHP Version: 5.1.6
New Comment:
Use NULL on third parameter.
Previous Comments:
------------------------------------------------------------------------
[2006-10-19 06:48:57] oglodek dot marek at pronox dot com
Description:
------------
there is not posibble (now) to set third(3)(length) parametr in
array_slice on end of table where you using preserve_keys. Now You must
write somthing like this:
array_slice($array, $offset, count($array), true);
my idea is => if length is true then set pointer at end of array:
array_slice($array, $offset, true, true);
ps: sorry for my english (i im polish:P)
best regards,
Marek Oglodek aka Tsharek (oglodek.marek@pronox.com)
Reproduce code:
---------------
line 2192 in array.c file(php 5.1.6):
if (argc >= 3) {
convert_to_long_ex(length);
length_val = Z_LVAL_PP(length);
} else {
length_val = zend_hash_num_elements(Z_ARRVAL_PP(input));
}
Expected result:
----------------
line 2192 in array.c file(php 5.1.6):
if (argc >= 3 && !zend_is_true(length)) {
convert_to_long_ex(length);
length_val = Z_LVAL_PP(length);
} else {
length_val = zend_hash_num_elements(Z_ARRVAL_PP(input));
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39194&edit=1