Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94478 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98008 invoked from network); 11 Jul 2016 20:15:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2016 20:15:40 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.50 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wm0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:36399] helo=mail-wm0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/72-17655-B6EF3875 for ; Mon, 11 Jul 2016 16:15:39 -0400 Received: by mail-wm0-f50.google.com with SMTP id f126so104206528wma.1 for ; Mon, 11 Jul 2016 13:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=xwYa/Srr8KejCobA9d9NvGzhzEHKZrmh4Fi+RfOEQVo=; b=zF6EXgSvDw2xboi96YSnipfAsYHVLa4nYtJwIJqO+8/CheQM0zO/3qaCOiRSymN6Fl MBspdg0EXbik83kg9UA35gr1oChmalDb2pIrdQwaFpYX7K8vrkdT9wG9J0Z3XQTHVcRY dKQfxwaY4l5bY/vwqZgZiHk91OAHyuK6gna3LaaZGgoV9JePX7wcqdNbYCy5f5PUeXIo y7GqJ0EYHQiBYu/fRvcp4uK981T9J4GZj2fcdy4KxUCNcUA4LnZywgZtmKvzvAcUZLKq dU9qeL34GsWQVq7smj1VcaITUiPH/KzyuMNxwifZnJLe+If3y1Pa+hx428TsvO0DfIq9 cE8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xwYa/Srr8KejCobA9d9NvGzhzEHKZrmh4Fi+RfOEQVo=; b=X5wbFXtN3CV0WojIj0OunrCoDBdkmkKQC11E0B9KYHq4NYyeBuGymt7FOIDaWxNHVB MIePgrSK9SixY9avLKREb3utqGSACC7XnV6u0++y0B7/QT9xSDzEJ3U+QfpTzjF3e26o 2U/wRvIMt0erjjmC66V1nuTnmVMXUq+ZzS/rh0awvZeZrs2gGlpSaCZvbOui71OHWMgF Gs8h/WfuE/XWVv0AubJnn7EbLxHTKfY2cJ8UcmsfR3PHeprOA9o5RyfGIFQ9q9gtBZbd 9hwEeqg/GuWZZBwYxsOMsVVEdXLRawWXHonUhPoYDEz5Cen2XaC38z5v/MDpLS6nMYfu wzqw== X-Gm-Message-State: ALyK8tJ3tbc+pZoF0cOVvT7yPVMCmIDj4Wb50ABHQswtaAPs7Kam7WNANPV1sMylTAa+Xw== X-Received: by 10.28.54.229 with SMTP id y98mr14004710wmh.96.1468268135172; Mon, 11 Jul 2016 13:15:35 -0700 (PDT) Received: from [192.168.1.191] ([2.25.96.65]) by smtp.googlemail.com with ESMTPSA id ah4sm1456468wjc.16.2016.07.11.13.15.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jul 2016 13:15:34 -0700 (PDT) To: internals@lists.php.net References: Message-ID: Date: Mon, 11 Jul 2016 21:15:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal for php7 class method return From: rowan.collins@gmail.com (Rowan Collins) On 11/07/2016 20:56, Marco Pivetta wrote: > On 11 July 2016 at 21:51, Jesse Schalken wrote: > >> does save the verbosity of repeating a variable name, and often saves a >> variable altogether: >> >> $blah = new Blah(); >> $blah->setFoo(1); >> $blah->setBaz(2); >> $this->setBlah($blah); >> >> >> becomes >> >> $this->setBlah((new Blah()) >> ->setFoo(1) >> ->setBaz(2) >> ); >> >> > Right: to save one variable assignment you now have 3 function calls. I > think I see your problem (if this is about performance) :-P Huh? There's exactly the same number of function calls. And who said this was ever about performance? Again, it's just different syntax for doing things we can already do. Even the object cascade operator is just hiding the assignment to a temporary variable - think of it like post-increment: $bar = $foo; $foo = $foo + 1; $bar = $foo++; $bar = $foo; $foo->inc(); $bar = $foo->>inc(); (I'm not suggesting this is a literal use case for the operator, just highlighting the parallels; please don't start picking at it.) Regards, -- Rowan Collins [IMSoP]