Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61542 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85811 invoked from network); 20 Jul 2012 07:44:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 07:44:42 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:37247] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/18-18983-A6C09005 for ; Fri, 20 Jul 2012 03:44:42 -0400 Received: by yhoo21 with SMTP id o21so4237355yho.29 for ; Fri, 20 Jul 2012 00:44:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=1QZav/gfYOtDZQiJnkCb83EI2sYqXIjguGpx1c2Xg/0=; b=i26PC6Klcz6g8OJwrTzLGTL0CH/fZWPNY1My+eehQQAs1U5DjxX7wSz4RNO0CMqsz3 TK0rcLWVNlCbbYE7ubp1arCdsrhvJrLVOUihWEK0TRBembwgPIRbimgiVcwUpAENMZKO hVD8SYHV7XMXPRbkPxMnHH1FkXOaDYYUG5Gt+sYYG3B6Qjc1rGhJD4jc2ucJyMRRIYFm IPEwz0Yb+kFsXzIZtteglRgcF/xzljS2J6EpPegrAfQDGjlgsRFMlgc70vUwNz2n28LC g3BVFRSkjesKyLYKTQ2Qn8f01iLTvXdUmJZttONda1Pt4xsER4L+suMI0BDBqZtidwNl Yvdw== MIME-Version: 1.0 Received: by 10.50.212.98 with SMTP id nj2mr7436438igc.35.1342770279509; Fri, 20 Jul 2012 00:44:39 -0700 (PDT) Sender: php@golemon.com Received: by 10.64.24.242 with HTTP; Fri, 20 Jul 2012 00:44:39 -0700 (PDT) X-Originating-IP: [67.164.28.199] In-Reply-To: References: Date: Fri, 20 Jul 2012 00:44:39 -0700 X-Google-Sender-Auth: yggpaMzYMWliCImp8fSKTcz0TjQ Message-ID: To: Andrew Faulds Cc: internals Content-Type: multipart/alternative; boundary=14dae93404f1866ea304c53e1153 X-Gm-Message-State: ALoCoQkyi8tY6QOxAwQiufponOn8ks7HYq1S6HDidaNgodQbczkrvHdq06LpRV1q4ZMxKQqTaVad Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: pollita@php.net (Sara Golemon) --14dae93404f1866ea304c53e1153 Content-Type: text/plain; charset=ISO-8859-1 As you suggested initially. Don't make them objects. You can leave them scalars and still give them methods all from an extension. Not via typical APIs, granted, but the engine hooks are all in there. On Thu, Jul 19, 2012 at 4:38 PM, Andrew Faulds wrote: > I'm curious, how do I make my objects have scalar passing semantics, then? > On Jul 20, 2012 12:35 AM, "Sara Golemon" wrote: > >> >> >> On Thu, Jul 19, 2012 at 2:42 PM, Andrew Faulds wrote: >> >>> I never said treat them as objects. I said give them methods. Not the >>> same thing. >>> >> Fair enough, noone is talking about giving them properties or formal >> class definitions. >> >>> And what do you mean by "technical debt"? >>> >> I mean that we'll never escape the functional side of PHP, nor should we >> try to. So we're not talking about replacing a set of APIs, we're talking >> about duplicating APIs which already exist. More than that, we're talking >> about creating a whole new branch of primitive handling in order to give >> them methods without actually giving them class methods. I'm not saying >> that any of this is difficult to do, I'm asking if it actually gains us >> anything which justifies doubling the number of implementations which deal >> with string, array, and scalar operation. >> >> Given that you can accomplish this with a PECL extension, my answer is >> "No, it doesn't." >> >> -Sara >> > --14dae93404f1866ea304c53e1153--