Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61493 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89376 invoked from network); 19 Jul 2012 15:49:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2012 15:49:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.161.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.161.170 mail-gg0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:46303] helo=mail-gg0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/F0-18983-48C28005 for ; Thu, 19 Jul 2012 11:49:26 -0400 Received: by ggnf2 with SMTP id f2so3335442ggn.29 for ; Thu, 19 Jul 2012 08:49:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=GpBD58LYSSABPBzb1kM53Ie4eh9trlw7SaAoubq4Tpw=; b=Cp45BPMZEbiz497k1KLQuWPg8K+AKwq2Wb8essY9DhHwiOIcVXXPN3Raj1EGQ0+BrS /2oNp5V/9yzk3eoMufjMqENz/QIzVbZhMxcdBLHQfb87+FI3OFsyJ/0/amvv4QKrWz+a S+sbrLEc5lU97EeQy0eFawkx3eMhPebt84vJvbaCQQ4ix6h/fh+OcRioyiet3DQgKcAs xaV6B41p3IOL4IEf4gMikixRhegZu/X790dUaHsZOzlktHJ3haaRK9FtkrefrSNIZGH4 zRNYr6HJUG+YZ6uHSWKSPKy2BKgdwe8DX3/szG9+mn6l1tHhnQpoUNxdTXHWoB1r6J+G 66yQ== Received: by 10.66.87.70 with SMTP id v6mr4736252paz.14.1342712961227; Thu, 19 Jul 2012 08:49:21 -0700 (PDT) Received: from [10.1.10.93] (173-11-2-218-oregon.hfc.comcastbusiness.net. [173.11.2.218]) by mx.google.com with ESMTPS id tq4sm2014608pbc.11.2012.07.19.08.49.19 (version=SSLv3 cipher=OTHER); Thu, 19 Jul 2012 08:49:20 -0700 (PDT) Message-ID: <50082C7E.4080400@lerdorf.com> Date: Thu, 19 Jul 2012 08:49:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Pierre Joye CC: Stas Malyshev , internals References: <50059AF8.5050805@sugarcrm.com> <5005CB58.2020601@sugarcrm.com> <50066724.6050901@sugarcrm.com> <50070538.10206@lerdorf.com> In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmyBowXc6aaI4ZpgA0hazmsa/1sXAVgKjfSpMGBIeVvGilWF/3giKmjVtkEXpVmMmzzIBF8 Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: rasmus@lerdorf.com (Rasmus Lerdorf) On 07/19/2012 12:25 AM, Pierre Joye wrote: > hi Rasmus, > > On Wed, Jul 18, 2012 at 8:49 PM, Rasmus Lerdorf wrote: > >> This makes no sense to me either. How does it let us clean the APIs? Can >> you give an example? I have one: >> >> $a = -5; >> $b = "-5"; >> >> echo $a->abs(); // Outputs 5 >> echo $b->abs(); // should still output 5 >> >> What has been cleaned here over: >> >> echo abs($a); >> echo abs($b); > > Heh, here is another example where it makes even less sense: time(); > > sigh. > > More seriously... we are not talking about these APIs and I am sure > you know which one I refer to, like the string API and the like. Ok, so for the string API: $a = 1; $a->strstr('1'); should still work. All the string API methods need to be available on every pseudo-object regardless of the type. So I don't see any "cleanup" here either. -Rasmus