Re: Re: Str enhancement, final run

From: Date: Tue, 10 Jul 2001 17:19:41 +0000
Subject: Re: Re: Str enhancement, final run
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59583@lists.php.net to get a copy of this message
I think we should not allow this, use substr() if you need more functionality. Stick to very simple things with the {} stuff.
ah hell, I think Andi not even thought at using substr() within {}. then my argumentation is something like void ;) these examples were meant perlish and will do harm of course. For me they're (negative indices and substr() method) completely interchangeable and as *this* range-solutions isn't incompatible with adding the "negative-indices"-feature afterwards, *I won't complain* if it'll not go in at first and I think others won't. <example> here a silly-but-simple-example(TM) how it *could* look like: $foo='peterralf'.fill_in_rubbish_string().'!'; print 'hello '.$foo{0..4}.', hello '.$foo{5..8}.' is this rubbish:'.substr($foo,9,-1).'?'; print 'hello '.$foo{0..4}.', hello '.$foo{5..8}.' is this rubbish:'.$foo{9..-1}.'?'; </example> this *almost* looks identical, why not simply use the {} syntax here? ok. if I was Andi or Zeev I could also argue, why not use substr() here, that's a point, because I don't see how this would be any harm. as I stated before I won't complain any longer about this as we possibly have found an agreeable solution regarding range-indices. andré

« previous php.dev (#59583) next »