Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71742 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67138 invoked from network); 29 Jan 2014 19:04:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2014 19:04:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.46 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.46 mail-oa0-f46.google.com Received: from [209.85.219.46] ([209.85.219.46:47047] helo=mail-oa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/12-52228-8A059E25 for ; Wed, 29 Jan 2014 14:04:09 -0500 Received: by mail-oa0-f46.google.com with SMTP id n16so2496857oag.5 for ; Wed, 29 Jan 2014 11:04:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=H+KkRkkjuLRFyI/WUI0Zdz5Pj0DCGXSPAyd5hGMBjbs=; b=dCmvtWYcejmZEPsCyvOeGdXYxDThDKtZ0WEwwvXz+rGZXT2pA4LYgz4xqJKkwT+v3x kQA2guKmApKgiqCjWmN8NKeJHwL79aJ3mWBy91hp9yB0A0NxAgrgPUIAZxV7Hsc1Vih0 tvMGJr0XXNIjo2heLtLK2SuNRt2yBE6mNFMDlK9+t5V/uVuBsoGqbMhNeg1lg6hdfsCr UrIIgkUd/Im3hgLtB6vdDHNCXTAIi9qTFTb+O1rdVh17xXuUb0HBJUxVkGD0Cel8pJa2 Crnpijmm/7cIxH0n8zpwv3Kbbzu0j0sXUmO2dYT4clelJokOpC5HIFgrSYVf2P4J0ETi 934g== MIME-Version: 1.0 X-Received: by 10.60.44.42 with SMTP id b10mr1931580oem.70.1391022246085; Wed, 29 Jan 2014 11:04:06 -0800 (PST) Received: by 10.182.54.112 with HTTP; Wed, 29 Jan 2014 11:04:05 -0800 (PST) In-Reply-To: <52E9469D.6000302@sugarcrm.com> References: <4ED7146272E04A47B986ED49E771E347BBC71EE3A9@Ikarus.ameusgmbh.intern> <52E9469D.6000302@sugarcrm.com> Date: Wed, 29 Jan 2014 20:04:05 +0100 Message-ID: To: Stas Malyshev Cc: Christian Stoller , Levi Morrison , Larry Garfield , internals Content-Type: multipart/alternative; boundary=001a11c30a04da498604f1209a77 Subject: Re: [PHP-DEV] Re: [PHP6] Function name consistency From: nikita.ppv@gmail.com (Nikita Popov) --001a11c30a04da498604f1209a77 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 29, 2014 at 7:21 PM, Stas Malyshev 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). Nikita --001a11c30a04da498604f1209a77--