Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46810 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76720 invoked from network); 19 Jan 2010 17:03:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2010 17:03:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.222.188 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.222.188 mail-pz0-f188.google.com Received: from [209.85.222.188] ([209.85.222.188:39579] helo=mail-pz0-f188.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/39-29385-CD5E55B4 for ; Tue, 19 Jan 2010 12:03:25 -0500 Received: by pzk26 with SMTP id 26so3120858pzk.26 for ; Tue, 19 Jan 2010 09:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=D60CzJqB68QOLvw2KiONiZOs0sQZ+ov/AWImA+U2bkk=; b=X2Iur6rfpnZkW5sb3tCR4dh9KrgejqDui5m/FFlzOukqGGuA/3JKtAabR+ceiuYLYq JgwQHkkpxSPwGrJ6bf9Y9+atn9ypRk+Wv4yNnIDuzHnHaSzmitOKLkfAsQRhWZGtYA05 +LdaCF+QKdjw40MD0pwY0KYq2Yp0dqVSmoU94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=sBiuMzFhrPro8BJa5xgobPUe85OFtFWTlS8056vw1z6LaMKwIcugRfsp/q77L6lbqu ZHSoLPaAkEgyn9jK1UL492gyPEars8HDEz1tXhXkNevwBQDwlK+nBF13fvk92MTM8X2R 2wldqJRio9Dc1gkinWme1eFAjzo9wMUpgIK24= MIME-Version: 1.0 Received: by 10.142.195.18 with SMTP id s18mr5342727wff.50.1263920601415; Tue, 19 Jan 2010 09:03:21 -0800 (PST) In-Reply-To: <4B54FC87.8070106@zend.com> References: <4B54FC87.8070106@zend.com> Date: Tue, 19 Jan 2010 10:03:21 -0700 Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] function call chaining From: chrisstocktonaz@gmail.com (Chris Stockton) Hello, On Mon, Jan 18, 2010 at 5:27 PM, Stanislav Malyshev wrote: > I wrote a small patch that enables this kind of syntax in PHP: > > foo()(); > ... I think language enhancements with no BC breaks that offer a wider toolset to programmers is a good thing. I would also like to see the other ideas in this thread implemented such as array access & object creation. The only thing I do not like about this is I do not beleive it fits the PHP error model. Lets just say Bar::foo($arg) returns a function callback or FALSE/NULL on a error condition. So you end up with a function call to something that is not callable, the PHP way under this case is to have a fatal error. I would rather not see more ways to cause fatal errors in PHP (call to undefined method has gotten a bit more popular since object chaining has risen in popularity as well). Of course I know exceptions are likely out of the question for these kinds of cases as well. These thoughts do not apply to array access or object creation. Regards, -Chris