Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37627 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79636 invoked from network); 13 May 2008 14:08:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 May 2008 14:08:18 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.141.85.117 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.141.85.117 uf1.search.ch Linux 2.6 Received: from [195.141.85.117] ([195.141.85.117:37814] helo=smtp.rim.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/77-56987-0D0A9284 for ; Tue, 13 May 2008 10:08:17 -0400 Received: from localhost (localhost [127.0.0.1]) by rolig.search.ch (Postfix) with ESMTP id 5869041F566; Tue, 13 May 2008 16:08:13 +0200 (CEST) Received: from smtp.rim.ch ([127.0.0.1]) by localhost (search.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28388-01; Tue, 13 May 2008 16:08:11 +0200 (CEST) Received: from [192.168.1.72] (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rolig.search.ch (Postfix) with ESMTP id D7C9641F234; Tue, 13 May 2008 16:08:10 +0200 (CEST) Message-ID: <4829A0C9.5050308@cschneid.com> Date: Tue, 13 May 2008 16:08:09 +0200 User-Agent: Thunderbird 1.5.0.12 (X11/20060911) MIME-Version: 1.0 To: Marcus Boerger CC: internals@lists.php.net References: <48169695.9040803@omegavortex.net> <7dd2dc0b0804290817v3d8de030y1208a88f78c44411@mail.gmail.com> <862660524.20080506162159@marcus-boerger.de> <912CE6DE-22D0-43E6-BB6B-6154980050E5@procata.com> <1210101672.3952.4.camel@localhost> <489751132.20080506214551@marcus-boerger.de> <10845a340805070633q2316a598lc1a69f259c523341@mail.gmail.com> <92634160.20080512164700@marcus-boerger.de> <10845a340805120803k2587870bnf890ce44765f5e97@mail.gmail.com> <721653902.20080513155302@marcus-boerger.de> In-Reply-To: <721653902.20080513155302@marcus-boerger.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at search.ch Subject: Re: [PHP-DEV] Class Properties in Interfaces? From: cschneid@cschneid.com (Christian Schneider) Marcus Boerger wrote: >> unset($o_Foo->bar); >> echo $o_Foo->bar; > ?>> > >> outputs ... >> Notice: Undefined property: foo::$bar in C:\- on line 13 > > At this point you found an error. Because this allows unset() to modify an > instance in a way that it nolonger adheres to its class that means at this > point the following is nolonger valid: $o_Foo is-a foo. And that is the > basic design rule we chose for PHP. Please file as a bug! So you are saying that $o_Foo->bar = array(42); is ok when the class "expects" a string but unset($o_Foo->bar); or (as as slight variation) $o->Foo->bar = null; is not? I'd ask not to change this behaviour as you'll just add another (IMHO bogus) restriction on how an object or class can be modified at runtime. An error possibly caused by this is already handled by the E_NOTICE message anyway. For comparison: Having to declare static class variables is a similar restriction which got in my way more often than it helped me. - Chris