Date: 07/15/01
- Next message: David Eriksson: "Re: [PHP-DEV] Newbie writing a PHP extension"
- Previous message: Nick Lindridge: "[PHP-DEV] session_set_cookie_params broken in 4.0.6"
- In reply to: Stig Venaas: "Re: [PHP-DEV] Re: Str enhancement, final run"
- Next in thread: Cynic: "Re: [PHP-DEV] Re: Str enhancement, final run"
- Reply: Cynic: "Re: [PHP-DEV] Re: Str enhancement, final run"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Yes, I think that for strings we should limit it to ranges
> like $foo{4..6}, and it would be neat if we for arrays could
> do $foo[4..6]. ":" might be just as well as "..". It is more
> intuitive with ".." I think, but I also kind of like having a
> single character.
4:6 is more of a soccer result than intuitive ;)
$foo[$a]
should return array(item)
$foo[$a..$n]
returns array of items $a to $n
it seems obvious to implement this for arrays, array_slice() and
substr() both have identical syntax.
you could easily cut bigger arrays into smaller ones then, without hazzle.
any opinions about array slicing in the language itself? IMO all points
discussed for string slicing also apply to array slicing
andré
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: David Eriksson: "Re: [PHP-DEV] Newbie writing a PHP extension"
- Previous message: Nick Lindridge: "[PHP-DEV] session_set_cookie_params broken in 4.0.6"
- In reply to: Stig Venaas: "Re: [PHP-DEV] Re: Str enhancement, final run"
- Next in thread: Cynic: "Re: [PHP-DEV] Re: Str enhancement, final run"
- Reply: Cynic: "Re: [PHP-DEV] Re: Str enhancement, final run"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

