Re: Re: [PHP6] Function name consistency

From: Date: Wed, 29 Jan 2014 18:21:17 +0000
Subject: Re: Re: [PHP6] Function name consistency
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-71738@lists.php.net to get a copy of this message
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. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#71738) next »