Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21977 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85624 invoked by uid 1010); 21 Feb 2006 22:48:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85609 invoked from network); 21 Feb 2006 22:48:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2006 22:48:43 -0000 X-Host-Fingerprint: 213.80.114.39 c39.a114.gbg.bahnhof.net Received: from ([213.80.114.39:23392] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 44/E4-45151-AC89BF34 for ; Tue, 21 Feb 2006 17:48:42 -0500 Message-ID: <44.E4.45151.AC89BF34@pb1.pair.com> To: internals@lists.php.net Date: Tue, 21 Feb 2006 23:48:37 +0100 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 References: <1758.192.168.1.102.1140560726.squirrel@192.168.1.3> In-Reply-To: <1758.192.168.1.102.1140560726.squirrel@192.168.1.3> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 213.80.114.39 Subject: Re: Change to function call semantics in PHP 5.1? From: jome@emoj.net (jome) Mark Spruiell skrev: > In PHP 5.0.x, I can chain function calls like this: > > $obj->method()->anotherMethod(); > > In PHP 5.1.x, this code results in an error: > > parse error, unexpected T_OBJECT_OPERATOR in ... > > I've looked through the change log for 5.1 but didn't see > anything relevant. jome@thisbe:~$ php -r 'class a { function b() { return new B; } } class B { function C() { echo "Works fine."; } } $a = new A; $a->b()->c();' Works fine. jome@thisbe:~$ php -v PHP 5.1.1 (cli) (built: Jan 7 2006 21:44:30) The error is somewhere in your code. /j