Re: Re: [PHP6] Function name consistency

From: Date: Wed, 29 Jan 2014 19:33:58 +0000
Subject: Re: Re: [PHP6] Function name consistency
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-71746@lists.php.net to get a copy of this message
Hi all, On Thu, Jan 30, 2014 at 4:04 AM, Nikita Popov <nikita.ppv@gmail.com> wrote: > > Hi! > > > > > 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. > > > > I think it has very little difference and entirely a matter of personal > > taste. But the thing is - nobody prevents anybody from writing an > > extension that does string ops or array ops as an object. Yet it did not > > happen in last 10 years, AFAIK. > > > > https://github.com/nikic/scalar_objects > > Also, the point of doing this is not the nicer syntax, but the opportunity > to improve the APIs in a reasonable fashion (no countless aliases). and/or https://wiki.php.net/rfc/autoboxing I think aliases would not be countless. It could be added matter of hours for all functions in php-src. Discussion for choosing proper name could be timeless :) Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#71746) next »