Re: substr/array_slice in []
| From: | Andrei Zmievski | Date: | Tue, 09 Oct 2007 02:32:42 +0000 |
| Subject: | Re: substr/array_slice in [] | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-32707@lists.php.net to get a copy of this message | ||
I will use an example:
$foo = substr($bar, 0, 5) . "-" . substr($bar, 5);
or
$foo = $bar[:5] . "-" . $bar[5:];
I would argue that the second line is hardly more cryptic than the first one. And if we were concerned that concerned about duplicate functionality, we probably wouldn't have SimpleXML and similar things.
-Andrei
http://10fathoms.org/vu - daily photoblog
On Oct 6, 2007, at 11:49 AM, Antony Dovgal wrote:
I believe it should be pretty clear that "too perlish" means "too cryptic and makes no sense because it duplicates already implemented functionality (more than one way to do it, yeah)". But "too perlish" is much shorter. --Wbr, Antony Dovgal