Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37644 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53612 invoked from network); 14 May 2008 10:48:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 May 2008 10:48:20 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.128.186 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.128.186 fk-out-0910.google.com Received: from [209.85.128.186] ([209.85.128.186:13182] helo=fk-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/E0-39724-273CA284 for ; Wed, 14 May 2008 06:48:20 -0400 Received: by fk-out-0910.google.com with SMTP id 18so2737914fks.7 for ; Wed, 14 May 2008 03:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=fhMBbYmK09B+wattE9QHL8v3vfvLUoCCA5kRlidsjCM=; b=LJuMjr+arLuerzsnwfJXl/fFKRdq9GNWZyMd9nxZTwe50X+VfQ+2YAqFsFyTKQM7IcgX6Ij1Em+91ceuTn7w/CqXwxZSFtAOhwZVEbb0hiKNO1NgUzxXjFhwURRjQUjNFkBYK8Ab6jEMabbHacUDSAiHLAodO+JLlvVHYvBSIdY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VOmD1DOVILkiIrI2XCiSGdvshCcxnwZYSJL0Lx/7PBXjqsA0tFzLd6eNsUaVmW21rsGaTz7qgYqfzvpOriQw021TkXYWZ0NbkiDiTWx4mE5GL79vCeWo2FXGI+ZgkSXngFLuZ+5bni/WlGFVqj4Sjnp2q/0kF5URVam9wMqiKtY= Received: by 10.125.86.1 with SMTP id o1mr230107mkl.11.1210762093951; Wed, 14 May 2008 03:48:13 -0700 (PDT) Received: by 10.86.60.20 with HTTP; Wed, 14 May 2008 03:48:13 -0700 (PDT) Message-ID: <10845a340805140348j15fa108dv6d616865779128c5@mail.gmail.com> Date: Wed, 14 May 2008 11:48:13 +0100 Reply-To: RQuadling@GoogleMail.com To: "Christian Schneider" Cc: "Marcus Boerger" , "Stanislav Malyshev" , internals@lists.php.net In-Reply-To: <76FF1B4A-1CAB-407A-9E6D-41E8C1137FCB@cschneid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48169695.9040803@omegavortex.net> <489751132.20080506214551@marcus-boerger.de> <10845a340805070633q2316a598lc1a69f259c523341@mail.gmail.com> <92634160.20080512164700@marcus-boerger.de> <10845a340805120803k2587870bnf890ce44765f5e97@mail.gmail.com> <721653902.20080513155302@marcus-boerger.de> <4829A0C9.5050308@cschneid.com> <1629174644.20080514020633@marcus-boerger.de> <76FF1B4A-1CAB-407A-9E6D-41E8C1137FCB@cschneid.com> Subject: Re: [PHP-DEV] Class Properties in Interfaces? From: rquadling@googlemail.com ("Richard Quadling") 2008/5/14 Christian Schneider : > > Am 14.05.2008 um 02:06 schrieb Marcus Boerger: >>> >>> 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 Do not get the connection here? And since when can we 'expect' a string >> only for a property? > > You stated that allowing unset() is a bug. I replied that unset() is not > different from setting the value to array(42) or null and should be allowed. > > Apropos 'expect': A programmer of a class can have some expectations of what > is stored in attributes, PHP does not enforce these expectations (hence I > put expect in quotes). And just to make it clear: I want to keep it that > way, I do not want PHP to become more strict than it is. > > So I completely agree with Stas here. > > - Chris Chris (and others). _IF_ the property was defined in an interface, should "unset" be "allowed" to remove the property? The current behaviour of allowing a property of a normal class to be removed is debatable. (It is currently doing so, so for BC it should probably stay as such). With the interface though, we _are_ saying we want to enforce its existence, so it must always exist and as such unset() would/should have no meaning and be an error (attempting to change an enforced interface structure). Maybe this is a difference for E_STRICT? Richard. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"