Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71746 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74631 invoked from network); 29 Jan 2014 19:34:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2014 19:34:43 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:42645] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/73-52228-1D759E25 for ; Wed, 29 Jan 2014 14:34:42 -0500 Received: by mail-la0-f45.google.com with SMTP id b8so1830294lan.4 for ; Wed, 29 Jan 2014 11:34:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ZhP8vzrruRN1Jsnbte+AzElVemQVY2TMwI7l5aTZB3U=; b=UAZvbIz93n8oi/MKA73ciTw9iSvcnx0XTjWLFiNRrOPH1EPW6ffg6BgC+DxFSR437u zcd4SEOJkkONTSd5UFLszslL31K2geCqn7j1IOWQxJke4YQmPhW06qZal6PUr7r4QAfK it5+uD2ITJnTvlEBxErtvsa112ZyRG05woazXJoC5sQIId8siElCZXDF9XadH0aoK+Qq 6rdkLCGKEAr9mTj+dn3FIoFxfdpQjY7GE+8saYAK9R7yFnm5SJo/wbUvfihPcEFoFYPh XWpjLyCpG+YjybGuYkTs8SBXhk7/kCZdq6PGOnPK/0tgT80lrRxlbAa3/5LPNcFqWmzd BcyQ== X-Received: by 10.112.158.131 with SMTP id wu3mr6263720lbb.6.1391024078753; Wed, 29 Jan 2014 11:34:38 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Wed, 29 Jan 2014 11:33:58 -0800 (PST) In-Reply-To: References: <4ED7146272E04A47B986ED49E771E347BBC71EE3A9@Ikarus.ameusgmbh.intern> <52E9469D.6000302@sugarcrm.com> Date: Thu, 30 Jan 2014 04:33:58 +0900 X-Google-Sender-Auth: vgXWkWeeiQ3wciQ37z3eVxNFHf4 Message-ID: To: Nikita Popov Cc: Stas Malyshev , Christian Stoller , Levi Morrison , Larry Garfield , internals Content-Type: multipart/alternative; boundary=001a11c37b3216958604f12108ea Subject: Re: [PHP-DEV] Re: [PHP6] Function name consistency From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c37b3216958604f12108ea Content-Type: text/plain; charset=UTF-8 Hi all, On Thu, Jan 30, 2014 at 4:04 AM, Nikita Popov 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 --001a11c37b3216958604f12108ea--