#23117 [Opn->Bgs]: Python-style array subsets

From: Date: Tue, 29 Apr 2003 14:45:03 +0000
Subject: #23117 [Opn->Bgs]: Python-style array subsets
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38723@lists.php.net to get a copy of this message
ID: 23117 Updated by: andrey@php.net Reported By: eblount at implode dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: All PHP Version: 5CVS-2003-04-08 (dev) New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. in PHP the Engine is "thin". For the first example use array_slice(). For the second use substr(). It's preferred to use {} instead of [] for strings. Previous Comments: ------------------------------------------------------------------------ [2003-04-08 16:08:43] eblount at implode dot com Hi, I would like to request Python-style array subsets, where the code would resemble the following: $subArray = $bigArray[10:20]; // $subArray contains elements 10 through 20 of $bigArray It could also be useful in strings: $myString = "Hello World"; $subString = $myString[3:8]; // $subString equals "lo Wor" I think this could be done without breaking backwards compatability, and I think it would increase productivity. Thanks, Eric Blount eblount@implode.com ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23117&edit=1

« previous php.bugs (#38723) next »