Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16899 invoked from network); 3 Jun 2009 20:49:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2009 20:49:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:41347] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/1A-19828-2C1E62A4 for ; Wed, 03 Jun 2009 16:49:06 -0400 Received: from [83.228.56.37] (port=3285 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1MBxOR-0001Uw-LL for internals@lists.php.net; Wed, 03 Jun 2009 15:49:04 -0500 Message-ID: <3949706BB9424F7FAC5AC708A01119DB@pc> To: Date: Wed, 3 Jun 2009 23:48:53 +0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0023_01C9E4A5.D9B4A080" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Test for edge cases with __get and property access flags From: sv_forums@fmethod.com ("Stan Vassilev") ------=_NextPart_000_0023_01C9E4A5.D9B4A080 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable Hi, I created a test that covers the current behavior of __get and access = flags in some edge cases: http://pastebin.com/d2ad892f5 Those are: 1. When a property is declared, but then unset via unset($this->foo), = __get will be called. 2. When a property is declared private/protected, then unset and set = again, it remains with the same access flags as originally declared = (i.e. a private property remains private when set again). 3. When the caller tries to retrieve $object->foo, and foo is a = private/protected member the caller has no access to, instead of an = error, __get is called. I'm not very sure the current behavior on item 3 is the best one (maybe = error should be thrown regardless?), but freezing on either would be = better than leaving it undefined :) My request is that the behaviors tested here are either improved for = correctness, or freezed as is. And then this test, or modified version = of it, is added to the PHP source code to faciliate that. Thanks. Regards,=20 Stan Vassilev ------=_NextPart_000_0023_01C9E4A5.D9B4A080--