RE: [PHP-DEV] Re: [PHP6] Function name consistency
| From: | Christian Stoller | Date: | Wed, 29 Jan 2014 15:08:21 +0000 |
| Subject: | RE: [PHP-DEV] Re: [PHP6] Function name consistency | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-71728@lists.php.net to get a copy of this message | ||
> On Thu, Jan 23, 2014 at 6:11 PM, Larry Garfield <larry@garfieldtech.com>wrote
> >
> > If we're going to do anything, be aggressive and far-reaching with it.
> > Build a proper language-level OOP design for string/array manipulation.
> >
>
> This is a completely honest, sincere question: Why should the language
> itself use an object-oriented design for everything it provides?
>
Compare:
$str = str_replace('-', '_', $str);
To: $str = $str->replace('-', '_');
Or: $keys = array_keys($array);
To: $keys = $array->keys();
I think it looks a lot cleaner, self-explaining, shorter, and if you are used to write OOP, it fits
better to the rest of your code.