Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53212 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70896 invoked from network); 8 Jun 2011 13:42:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jun 2011 13:42:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=christian.kaps@mohiva.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christian.kaps@mohiva.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mohiva.com from 178.63.228.54 cause and error) X-PHP-List-Original-Sender: christian.kaps@mohiva.com X-Host-Fingerprint: 178.63.228.54 elvis.mohiva.com Linux 2.6 Received: from [178.63.228.54] ([178.63.228.54:37539] helo=elvis.mohiva.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/23-48516-14C7FED4 for ; Wed, 08 Jun 2011 09:42:25 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by elvis.mohiva.com (Postfix) with ESMTP id 1C1451D24013 for ; Wed, 8 Jun 2011 15:42:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at mohiva.com Received: from elvis.mohiva.com ([127.0.0.1]) by localhost (elvis.mohiva.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R00MXghpumfB for ; Wed, 8 Jun 2011 15:42:19 +0200 (CEST) Received: from elvis.mohiva.com (elvis.mohiva.com [178.63.228.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: christian.kaps@mohiva.com) by elvis.mohiva.com (Postfix) with ESMTPSA id AEEC81D24011 for ; Wed, 8 Jun 2011 15:42:18 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 08 Jun 2011 15:42:18 +0200 To: In-Reply-To: References: <67f900ce904612afdba7650ccbed6ed4@mohiva.com> <4ec16f049f8a5946bca7e81ecec50b45@mohiva.com> Message-ID: <7e90b49a7cc06e20a3a5b79cff202a73@mohiva.com> X-Sender: christian.kaps@mohiva.com User-Agent: Roundcube Webmail/0.5.2 Subject: Re: [PHP-DEV] Re: $arr =?UTF-8?Q?=3D=20array=28=27Hello=27=2C=20?= =?UTF-8?Q?=27world=27=29=3B=20=24arr=28=29=3B?= From: christian.kaps@mohiva.com (Christian Kaps) On Wed, 8 Jun 2011 09:46:26 -0300, Felipe Pena wrote: > > It works in the same way: > > class foo { > public function __construct() { > $this->bar = function () { return 1; }; > // $this->bar(); // error > $x = $this->bar; > $x(); // ok > > $this->bar = array($this, 'baz'); > // $this->bar(); // error > $x = $this->bar; > $x(); // ok > } > public function baz() { > echo 'baz'; > } > } OK, my mistake. I thought a property which holds a closure can be called directly. Thanks for clarification. Christian