Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61415 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19468 invoked from network); 18 Jul 2012 16:46:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2012 16:46:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:58480] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/01-39169-648E6005 for ; Wed, 18 Jul 2012 12:45:59 -0400 Received: by wibhn17 with SMTP id hn17so4169039wib.11 for ; Wed, 18 Jul 2012 09:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uQDWrfUf2QKE0NqeMc64B/4X7B61f1/i1bodLn+Rin0=; b=OdRvhyJ6UEd5PEm67jKuz1ZO7r1vdzueKmv5eA5S+7O7v181XgMnpNL5y73S1XoJW/ YOR5Q7XDVGwH73Lu04zIt3JOMNj2e0O0426D787NoQu3do+cTQwpzHktk4agEBaFSVca Fp4O2khCp7Du4dK54BjZEKjviUqvJkuZukSfWsrMXPpx3Z7jpjeEhOq82RydUw8b5uIb S5yhAk2GCOKi2Tb0hMgzM/v94Z5mNJWVI/K2D5o4OHxXMk6Ymfvg5TigpyC4DQFzvzLh zmWorl1mrIZ/Ce0IzoCXEGHlQ6qMCsdstS6Tf0U73mTo/lO+wu4LAb0YFQVF7G5g/h5R ELwA== MIME-Version: 1.0 Received: by 10.216.240.196 with SMTP id e46mr27965wer.224.1342629956075; Wed, 18 Jul 2012 09:45:56 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Wed, 18 Jul 2012 09:45:55 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Wed, 18 Jul 2012 09:45:55 -0700 (PDT) In-Reply-To: <5006E5BB.50906@sugarcrm.com> References: <50059AF8.5050805@sugarcrm.com> <5005CB58.2020601@sugarcrm.com> <50066724.6050901@sugarcrm.com> <50067040.3090307@sugarcrm.com> <5006E5BB.50906@sugarcrm.com> Date: Wed, 18 Jul 2012 17:45:55 +0100 Message-ID: To: Stas Malyshev Cc: Pierre Joye , internals Content-Type: multipart/alternative; boundary=e0cb4e43cff198c14304c51d6595 Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: ajfweb@googlemail.com (Andrew Faulds) --e0cb4e43cff198c14304c51d6595 Content-Type: text/plain; charset=UTF-8 WHAT? Er, sorry, accidental capslock. This IS a new API. That was an example. I'm not saying just put -> everywhere, I'm saying we can keep array_* and add a new set of -> functions which are well-designed, consistent, etc. On Jul 18, 2012 5:35 PM, "Stas Malyshev" wrote: > Hi! > > > enough but I don't know the Zend engine well enough). This way we can > > have array->key, array->sort(TYPE), etc. for new code to use, instead of > > the legacy array and string method mess (the latter needs a cleanup more > > in particular). > > The mess does not exist because we have array_key() instead of > array->key(). There's nothing wrong with having array_key(). The mess > exists because functions do not form single API with single principle > behind it, but were added in ad-hoc manner, sometimes without > correlating them with others. So, if you want to clean it up, you'd want > to write a plan how new API would look like and how it will be better > than old one. If the solution is "let's use ->" then it's not worth it. > The solution that's worth it is "let's have this better API" and that's > where we should start, not with changing array_key() to array->key() and > saying "now we have clean sexy API". > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > --e0cb4e43cff198c14304c51d6595--