Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64202 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55714 invoked from network); 8 Dec 2012 22:37:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2012 22:37:15 -0000 Authentication-Results: pb1.pair.com header.from=adamjonr@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=adamjonr@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: adamjonr@gmail.com X-Host-Fingerprint: 209.85.216.49 mail-qa0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:36916] helo=mail-qa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/26-13109-A11C3C05 for ; Sat, 08 Dec 2012 17:37:15 -0500 Received: by mail-qa0-f49.google.com with SMTP id r4so648414qaq.8 for ; Sat, 08 Dec 2012 14:37:12 -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=Lj2ORPwZHonePMiKHXGgeOAheC0kiRgz+ACBGPJZ2jo=; b=JcEqUdRhM7azwiBvCBpZZIGnjjyVv3dO6TZwKNrDwiyv20Ow46VB//fSh+V1zOtHUB CZATHTU0e4WQzLQUT0HiK3rG5JrpudfakaEjWhKnlavu5Pu3lUH75/yQ/5ZhQzNA2orG nLiL4Oo5t1Ne9Tl6jt4On/VgNVIRF6Eu0hz2zOTPWgPpi4khwFEf+cceyE8UK/EZU2x0 AbJDdfXKV7in5Bqw1ZtBfISDwrRQf7/ERZ0G5LEzcHiBBTr2LxWGdAMbAtHiGuYHTSvY PgcX/hgBh6/8mselo2dkc8E6vjlgrdYYVM2B5FD3Gad3Vv0asoLQ/L3PG0TPaR1SbeCO a0Ig== MIME-Version: 1.0 Received: by 10.224.78.148 with SMTP id l20mr18246297qak.27.1355006232451; Sat, 08 Dec 2012 14:37:12 -0800 (PST) Received: by 10.229.206.202 with HTTP; Sat, 8 Dec 2012 14:37:12 -0800 (PST) In-Reply-To: <50C3B9A1.7090403@sugarcrm.com> References: <50C3B9A1.7090403@sugarcrm.com> Date: Sat, 8 Dec 2012 17:37:12 -0500 Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf306f7514275b9104d05ef965 Subject: Re: [PHP-DEV] Call closure stored as object property directly without use of temporary variable From: adamjonr@gmail.com (Adam Jon Richardson) --20cf306f7514275b9104d05ef965 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Dec 8, 2012 at 5:05 PM, Stas Malyshev wrote: > Hi! > > > Has anyone else wanted this functionality? Has anyone else thought of > ideas > > of addressing this (or come to the conclusion it really isn't safely > > addressable without causing disproportionate amounts of grief?) > > Yes, there were people that wanted this functionality, but since having > the same thing ($foo->bar()) mean two different things (call method > named "foo" vs. "fetch property named foo and then call it if it's > callable") is not a good idea this wasn't done. > In some languages, the options above are the same - i.e. methods and > properties are actually the same thing - but in PHP is is not so, and > can be made so without some BC-breaking changes. > As it stands now, calling a method can mean two different things: calling the method directly, or handling the method invocation within __call(). Checking for a method first, a closure instance next, and then falling through to __call() seems like it would have been a reasonable approach. That said, as you mention BC-breaking is now an issue. Thanks, Adam --20cf306f7514275b9104d05ef965--