Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37365 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88754 invoked from network); 30 Apr 2008 16:59:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2008 16:59:18 -0000 Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain strojny.net designates 78.46.69.2 as permitted sender) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 78.46.69.2 milch.schokokeks.org Received: from [78.46.69.2] ([78.46.69.2:58946] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/16-55591-465A8184 for ; Wed, 30 Apr 2008 12:59:18 -0400 Received: from [192.168.0.100] (xdsl-87-78-213-244.netcologne.de [::ffff:87.78.213.244]) (AUTH: PLAIN lars@schokokeks.org, SSL: TLSv1/SSLv3,256bits,CAMELLIA256-SHA) by milch.schokokeks.org with esmtp; Wed, 30 Apr 2008 18:59:13 +0200 id 000000000000C007.000000004818A561.000074E9 To: Stanislav Malyshev Cc: "John Carter -X (johncart - PolicyApp Ltd at Cisco)" , internals@lists.php.net In-Reply-To: <4817596B.8020109@zend.com> References: <48169695.9040803@omegavortex.net> <339714303.20080429114607@marcus-boerger.de> <4817596B.8020109@zend.com> Date: Tue, 29 Apr 2008 20:33:21 +0200 Message-ID: <1209494001.31298.17.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_milch.schokokeks.org-29929-1209574753-0001-2" X-Mailer: Evolution 2.22.0 Subject: Re: [PHP-DEV] Class Properties in Interfaces? From: lars@strojny.net (Lars Strojny) --=_milch.schokokeks.org-29929-1209574753-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Stas, hi everbody, Am Dienstag, den 29.04.2008, 10:22 -0700 schrieb Stanislav Malyshev: [...] > In any case, whenever you want to write $foo->bar, just write=20 > $foo->getBar() and $foo->setBar(), and it'd work :) I think the issue is, that PHP does not have defined properties with attached validation (yes, I know about __get()/__set()). Now we just have plain properties that may contain everything. If we would have something like this: class Clazz { public $property { function get() { return $this->property; } function set($property) { $this->property =3D (int)$property; } } } In this case it, maybe it would make sense to allow definitions of properties in interfaces. For example the following could require a property to be read only: class Clazz { public $property { function get(); } } An interface defines a halfway strict API. Allowing the current properties in interfaces would not add any sensible functionality because it would not define the API better. cu, Lars --=_milch.schokokeks.org-29929-1209574753-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: Dies ist ein digital signierter Nachrichtenteil -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iQIcBAABAgAGBQJIF2nxAAoJECQPF+sCY6wHqVQP/0ToUu7xU8legUBGi1pQdPmx T/EmAqoFyncyNdWhshjeFghhOHlWASKjLTYuraaKBJxctp2jGcM3UbMljBcLyv+a qPgpnGiTYJ5rB9OWR4NwF6qzSwtYSRuD2b7YZ2SBJ7oaWnckNkpaOfilS0j2kY7Q +8PZJNKzB/bOn0kGddX/WP2sXexS5T1uJAM0t79oYzB7tsChkQz/3hOm0ZOM8GXg R0UMBbigpVaW9eiiL7vuBtIdJx5hhMehfK/VyLoWQfnkLiO0uKV2+LJyVenstCOl Ex3TKHU+UkXErXbJMire/nsfKeHT7n23Cq8sfojyu2/stmcKaLgUyEGoELxTv2mp Jv6Cf2qdvf7yrL1pK13IBkFWodvBOuUK69oUT+iX23g5Fd+SYU+LdYr2njKkhPJh gBCKLBpoYRS3WQS03WY6x5ry5eS/1v/GN1a9qtSu+MDjw6u6plvUy97dUfdToQc1 ITiQ9Lw85zVhIwdZ35wXbfKBOI3rPMpx5i5S6WHt5521HlveMF8ZHzhf/+z4DiFe R8iWQOpaAKbxgF8VKbH2Kl/CUizPR3RUj7ZGPJywMZY887EWdAN424VU/IR8WTui MM2WHmt6XUNsepO8BJBvOiJPCRynbGza/x3iCr/Bzh7RXNAAHPVxNMpB3OTpeV1l Sf/o3i+Rrp1GOoqh6xDp =88fB -----END PGP SIGNATURE----- --=_milch.schokokeks.org-29929-1209574753-0001-2--