Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87584 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66188 invoked from network); 3 Aug 2015 19:43:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2015 19:43:52 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.169 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.169 mail-pd0-f169.google.com Received: from [209.85.192.169] ([209.85.192.169:36035] helo=mail-pd0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/00-65350-774CFB55 for ; Mon, 03 Aug 2015 15:43:51 -0400 Received: by pdco4 with SMTP id o4so12179254pdc.3 for ; Mon, 03 Aug 2015 12:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=mBRwcHsHNmQEZRq81OuzsT1xHp08JmuVP6aQ3rvbkds=; b=sgWY+3EEctay7V9F657LzqxjTNeXM7cBFWlJp+zp+uxrXxqipsbYzlfI0Gi9UAYF8N cQBYlho2wS4lY4MwUw9sK4hEhAMJLErte2fwkoqRlBc2nXStticFQeVBKwGxwYQ5f5iR lmoMXrsVRMw+RgnR8Z/KFuIljp0jai37PHQjrYGHa6ORptJvDgtBOexYmCH87KJA39jr 0V3F51cVpp9ZA5Okjk1t7trP2PPRf+zp7k7NQjzcNPb3yctC5v1+3PThtmvSsJ9ZITs8 oP6LuKN/6qm9nIRcimEkfgADjzCA2tCrNmuwLj6BYMC6GDMzUnK3iLldFseU1mAHEuO1 Ewvw== X-Received: by 10.70.38.69 with SMTP id e5mr38898558pdk.27.1438631028612; Mon, 03 Aug 2015 12:43:48 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by smtp.gmail.com with ESMTPSA id kw10sm8776800pbc.83.2015.08.03.12.43.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 12:43:47 -0700 (PDT) To: Nicolai Scheer , PHP Internals References: Message-ID: <55BFC469.7080706@gmail.com> Date: Mon, 3 Aug 2015 12:43:37 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Access of protected members From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > just stumbled upon a strange issue. > I always thought that protected/private member variables can only be > altered from inside the object. No, it's not correct. Private members are visible withing this class' scope, protected members are visible within this class' hierarchy. The reason is that private is considered a detail of implementation of particular class (thus visible to this class only), and protected is a member of this class internal API (i.e. visible to extending classes but not to external users of the class). -- Stas Malyshev smalyshev@gmail.com