Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18408 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77107 invoked by uid 1010); 25 Aug 2005 10:37:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 77091 invoked from network); 25 Aug 2005 10:37:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Aug 2005 10:37:55 -0000 X-Host-Fingerprint: 195.141.85.117 uf1.search.ch Linux 2.4/2.6 Received: from ([195.141.85.117:51305] helo=verksam.search.ch) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6D/C5-28235-28F9D034 for ; Thu, 25 Aug 2005 06:37:55 -0400 Received: from localhost (localhost [127.0.0.1]) by verksam.search.ch (Postfix) with ESMTP id E40CC3A046B; Thu, 25 Aug 2005 12:37:50 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XX3t3iOa; Thu, 25 Aug 2005 12:37:50 +0200 (CEST) Received: by verksam.search.ch (Postfix, from userid 65534) id 343303A046C; Thu, 25 Aug 2005 12:37:50 +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 verksam.search.ch (Postfix) with ESMTP id CB5983A046B; Thu, 25 Aug 2005 12:37:48 +0200 (CEST) Message-ID: <430D9F7C.3020501@cschneid.com> Date: Thu, 25 Aug 2005 12:37:48 +0200 User-Agent: Mozilla Thunderbird 1.0 (X11/20041207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marian Kostadinov Cc: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on verksam.search.ch X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 X-Virus-Scanned: by amavisd-new at search.ch Subject: Re: Real properties in PHP From: cschneid@cschneid.com (Christian Schneider) Marian Kostadinov wrote: > public getter fullName { // may also have () > return "{$this->firstName} {$this->lastName}"; > } > > public setter fullName ($value) { // may also not have ($value) but > a special var. > list ($this->firstName, $this->lastName) = explode (' ', $value, 2); > } This can be easily done with function __get($name) { $get = "get_$name"; return $this->$get(); } function __set($name, $value) { $set = "set_$name"; $this->$set($value); } in your base class (the function names are then get_fullName/set_fullName. - Chris