Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71739 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62514 invoked from network); 29 Jan 2014 18:52:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2014 18:52:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:42027] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/01-52228-4DD49E25 for ; Wed, 29 Jan 2014 13:52:06 -0500 Received: by mail-lb0-f170.google.com with SMTP id u14so1778357lbd.15 for ; Wed, 29 Jan 2014 10:52:02 -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=UiHFTxl0W0v6Bh56XKp/Pmzdc8xOLc4BoAEGqI4khkU=; b=nthC7DyK3ARSkEMBPfI9CDEZzkrdRbd4uIqThFJnGvS9BbWmwdVLjpSuL1rJEnoAXT 1SGkeIbGWZ1KdUjsHA8Qg8UeQg3cUcGfKWLUqddYP+1ycgyDsT2TGNZdukLAIdBArgVn fVuTd2ukozs9qyUZdLORB144P+ROMpr26g3akxYa7QJ4lv6jH8uvmREMrgtPCbPpic+X PY3EzU4kF2Hhxangvb/WXYTBk5UNhEiW+eFGovYsXE7vwr6ZuuEyJz4ofSwZOyc4R7mc 9nUW5XmicmV7rgOeVdi2LXye+nq/uqSKfMrw8x/mQkUxOB1CRpL658odbezE9gyiDa2F m7Cw== X-Received: by 10.112.172.69 with SMTP id ba5mr1828718lbc.55.1391021522108; Wed, 29 Jan 2014 10:52:02 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Wed, 29 Jan 2014 10:51:21 -0800 (PST) In-Reply-To: <52E9469D.6000302@sugarcrm.com> References: <4ED7146272E04A47B986ED49E771E347BBC71EE3A9@Ikarus.ameusgmbh.intern> <52E9469D.6000302@sugarcrm.com> Date: Thu, 30 Jan 2014 03:51:21 +0900 X-Google-Sender-Auth: tp7sI8LpMS-sLXaEz7CWa3GEsbw Message-ID: To: Stas Malyshev Cc: Christian Stoller , Levi Morrison , Larry Garfield , internals Content-Type: multipart/alternative; boundary=001a11c23404b3467404f1206f41 Subject: Re: [PHP-DEV] Re: [PHP6] Function name consistency From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c23404b3467404f1206f41 Content-Type: text/plain; charset=UTF-8 Hi Stas, On Thu, Jan 30, 2014 at 3:21 AM, Stas Malyshev wrote: > > 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. It was said and didn't happen... I would like to make session/pgsql a class some day. I don't know when it will be, since I'm satisfied with current implementation. Besides OO API, we should keep function API. It may be confusing to users if OO and function name differs. It may be good to add proper aliases now and when it is needed, so that we don't have const zend_function_entry server_additional_functions[] = { PHP_FE(cli_set_process_title, arginfo_cli_set_process_title) PHP_FE(cli_get_process_title, arginfo_cli_get_process_title) PHP_FE(apache_request_headers, arginfo_no_args) PHP_FE(apache_response_headers, arginfo_no_args) PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args) {NULL, NULL, NULL} }; this kind of naming anymore. I understand reason why, but *new* 'apache_*()' function in cli server does not make much sense to me. For this case, I suggest 'sapi_*()' or 'http_*()' as main name and others as aliases. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c23404b3467404f1206f41--