Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47051 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3165 invoked from network); 24 Feb 2010 12:17:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2010 12:17:22 -0000 Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.219.220 mail-ew0-f220.google.com Received: from [209.85.219.220] ([209.85.219.220:33955] helo=mail-ew0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/E2-24347-1D8158B4 for ; Wed, 24 Feb 2010 07:17:22 -0500 Received: by ewy20 with SMTP id 20so772008ewy.1 for ; Wed, 24 Feb 2010 04:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=oROFyLEDyWnnReAsRHUyJnNrkle4cUH5wrqu0N/fy6s=; b=F3LyLAa7npDKI9bTUZ4nMzAM4+2XPQvV8ubm6XNBDZHTCSjbZgOkO0ngrTmHBeM0+X X6qOUslQqgsoumCtj1odIlybvinJ+CM3nDoUI/QkyUkwSEtNZQ++7EXfFFby66Hf3J0f zfsPr0ejeoyc/hotDsVv5FysfZ/j85U1xYa1Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=acZz37Ob5T+xzbOHUrLrJ7J2LCg6/uTsaNZQFhU4xM0Dio8mQKhrbZaS1ZKv5Y/CWw BWUQ6ccxN9IBP9JJZkvA6NXcCyjWn5sPzCZB+vdVoNupkX79C5ewQpZG0sGChHCVeRcY +lvAhBTv0iROeAEYTcPHCIdlbdb2Lr5tEOOjE= Received: by 10.213.109.77 with SMTP id i13mr2947302ebp.82.1267013838454; Wed, 24 Feb 2010 04:17:18 -0800 (PST) Received: from ?192.168.1.15? ([93.185.190.227]) by mx.google.com with ESMTPS id 13sm794356ewy.1.2010.02.24.04.17.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Feb 2010 04:17:17 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii In-Reply-To: <20100224121107.GH4565@phcomp.co.uk> Date: Wed, 24 Feb 2010 15:17:14 +0300 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <1E64D1BA-BF13-4720-9E13-2052285CC6F1@gmail.com> References: <4B54FC87.8070106@zend.com> <4F.56.22457.408955B4@pb1.pair.com> <4B55D850.8000604@zend.com> <4B808294.1070801@keryx.se> <4B844DBA.4050804@zend.com> <4B845E0C.7040005@gmail.com> <20100223232328.GE16412@phcomp.co.uk> <4B84CEB1.2070400@zend.com> <20100224102812.GB4565@phcomp.co.uk> <20100224121107.GH4565@phcomp.co.uk> To: Alain Williams X-Mailer: Apple Mail (2.1077) Subject: Re: [PHP-DEV] variables in namespaces, was: On closures and lamdba From: indeyets@gmail.com (Alexey Zakhlestin) On 24.02.2010, at 15:11, Alain Williams wrote: > On Wed, Feb 24, 2010 at 02:20:38PM +0300, Alexey Zakhlestin wrote: >>=20 >> On 24.02.2010, at 13:28, Alain Williams wrote: >=20 >>> Objects are not always the answer. >>=20 >> in situation, which you described, objects are definitely the answer. >> you have several functions, which share the same "state". that's very = close to the definition of object. >=20 > Maybe 'private static' -- ie shared between different objects. > It is not always appropriate, eg a generic logging function, called = from all over > the place - it is not always convenient to pass a logging object = around; > you just want to call the logging function. this one is solved by singleton ;) gives real protection for "private" var as a bonus=