Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50596 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55409 invoked from network); 26 Nov 2010 20:23:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2010 20:23:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:50542] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/60-52610-E3710FC4 for ; Fri, 26 Nov 2010 15:23:26 -0500 Received: by yxi11 with SMTP id 11so1222788yxi.29 for ; Fri, 26 Nov 2010 12:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=qEZlPtnt7PWZxgEYd5r4FhE8fDB2tKdLfNK8Qm6HvPI=; b=eEBmUoH32JisZPIKZClUkWMu+BKL+d0tjXQk7fLXSkQTO0fi/pD7fCghLrHqR7K83A MsKFiGiBiXHhOlL4hDJobSQt4gfvcJBg9poAyquqElnVX2qOqOOK5yfHL76ku/qZ83uk 0sWjHCVp4Q0TiDpZJi5ScYUXmIZdmwP7kGXcY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=LjwSTWpLB7DxqWYCFOeCdemc8BMTYI4svBkjGbRHAbDY+CPzxr5H2RLCOm/7sLKLJu /EVPvPpXiYhdYaCzDY8j/HTI/hP8Zq6gP67hXsFGIqPojxfnuQEOX9W6vFk/d36ZWeLI R7tzEHlIbB9vCu2KnnMAAgggEEW9iq/ppTCAk= MIME-Version: 1.0 Received: by 10.90.39.6 with SMTP id m6mr5010967agm.60.1290803003805; Fri, 26 Nov 2010 12:23:23 -0800 (PST) Sender: tyra3l@gmail.com Received: by 10.90.53.4 with HTTP; Fri, 26 Nov 2010 12:23:23 -0800 (PST) In-Reply-To: References: Date: Fri, 26 Nov 2010 21:23:23 +0100 X-Google-Sender-Auth: gbdHdX3pnkLO80jKyfvdYt2RuQc Message-ID: To: Felipe Pena Cc: internals Content-Type: multipart/alternative; boundary=0016361e7b448454510495fa7e6b Subject: Re: [PHP-DEV] [RFC] new foo()->bar() From: info@tyrael.hu (Ferenc Kovacs) --0016361e7b448454510495fa7e6b Content-Type: text/plain; charset=UTF-8 On Fri, Nov 26, 2010 at 8:36 PM, Felipe Pena wrote: > Hi all, > I'm here again to presents another proposal, which adds support for > instantiating a class and calling its methods and accessing its properties > on same command. > > Example: > > > class bar { > public $x = 'PHP'; > } > > class foo extends bar { > public function bar() { > return $this; > } > } > > var_dump(new foo()->bar()->x); // string(3) "PHP" > > ?> > > Other examples which describes the feature at > http://wiki.php.net/rfc/instance-method-call > > Thoughts? > > -- > Regards, > Felipe Pena > I like it, and it is a good pair with the new array dereferencing, so hopefully I don't have to create temp variables anymore \o/ Tyrael --0016361e7b448454510495fa7e6b--