Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47049 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90132 invoked from network); 24 Feb 2010 11:20:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2010 11:20:55 -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:62122] helo=mail-ew0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/00-24347-69B058B4 for ; Wed, 24 Feb 2010 06:20:54 -0500 Received: by ewy20 with SMTP id 20so743662ewy.1 for ; Wed, 24 Feb 2010 03:20:51 -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=hqEshZi3s58eUUJYz8U5ycuuxjlJ2OPsMI0XzsC4IBg=; b=hMUinZhi8mLreuAjbwBSwUfzT3IPxEzLTabFAD930krNOPa483GJZhmeH5WRotfXbr EkOY3j/x0m4Gpq2FK9lFPid67O8vdS13wmToM/DripMfLOyFFzs8Sop01qKuLHaWHgp/ HemII+1MuKmUPkHodSjJbOMNw3wCjAVlEjusE= 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=dmWGFMzaHqUiJ94RtPNYZX66YY/zCMfxiuVcOCjhCkv6rmv+4guUPKbULvXoayUv07 wwKoNsqhI9HUKQWd9mseTPqR9YVhseSwRd4viqkABFeT2SN2GuQlnHyaSeRLOOtAcUsM S056foprMDl0Y5BkIw+AWHvg17d2HOaopFdMg= Received: by 10.213.96.5 with SMTP id f5mr255161ebn.92.1267010448978; Wed, 24 Feb 2010 03:20:48 -0800 (PST) Received: from ?192.168.1.15? ([93.185.190.227]) by mx.google.com with ESMTPS id 16sm766482ewy.15.2010.02.24.03.20.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Feb 2010 03:20:47 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii In-Reply-To: <20100224102812.GB4565@phcomp.co.uk> Date: Wed, 24 Feb 2010 14:20:38 +0300 Cc: Stanislav Malyshev , "Ionut G. Stan" , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: 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> 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 13:28, Alain Williams wrote: > On Tue, Feb 23, 2010 at 11:01:05PM -0800, Stanislav Malyshev wrote: >> Hi! >>=20 >>> I never did understand *why* variables were not namespaced. >>=20 >> If you have so many global vars you need to namespace them, you = should=20 >> not use global vars. >=20 > It is not a question of number -- you may have some module where the > functions need to share a couple of variables between themselves, eg a = file handle. > If variables could be private to a namespace then you would be = confident that > you would not get a variable name collision with some other, = independently developed, > module. >=20 > Objects are not always the answer. 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.=