Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64547 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37414 invoked from network); 5 Jan 2013 12:25:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2013 12:25:50 -0000 Authentication-Results: pb1.pair.com header.from=j.boggiano@seld.be; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=j.boggiano@seld.be; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain seld.be designates 209.85.215.180 as permitted sender) X-PHP-List-Original-Sender: j.boggiano@seld.be X-Host-Fingerprint: 209.85.215.180 mail-ea0-f180.google.com Received: from [209.85.215.180] ([209.85.215.180:35206] helo=mail-ea0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/3F-38386-CCB18E05 for ; Sat, 05 Jan 2013 07:25:49 -0500 Received: by mail-ea0-f180.google.com with SMTP id f13so6986198eai.11 for ; Sat, 05 Jan 2013 04:25:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=zU547+39s5LY0kX8iKciLKt3JYFhoYN9r/LfKKjzk1U=; b=lDd7Vi4Y0x5iJZBu/Wwr+LDFt6OYRtkyHye2dqt32BT0JdbcZLWYsGDgOHP2ackUpz H0TTQBhSDqGswUztpLDF2FVzxiW4uu51UlZPNLmOUuT/wgNAQcc7XLL+VYL/AxjN3oPt vPtkKWoldHwUhkjc9vw6V+zRMpoLn+Blg+64POzEDh9MrZUY9q9+PNEWJ1FyId0QXBBC f8sos44oEqk0qjwbjh3+TF/C+J5c5wJNBQW1sWDidqCLnV6UEioVfv0cVIIwtWx4T6ln 6bq5g0+/99vte2nh+K8PmFVijFz1KYqPbRo17IYnxpVrHkacYXahVPUTOqVH4ireuQYJ oarQ== X-Received: by 10.14.194.195 with SMTP id m43mr152342285een.44.1357388745595; Sat, 05 Jan 2013 04:25:45 -0800 (PST) Received: from [192.168.1.36] (77-57-163-132.dclient.hispeed.ch. [77.57.163.132]) by mx.google.com with ESMTPS id 44sm117118825eek.0.2013.01.05.04.25.43 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Jan 2013 04:25:44 -0800 (PST) Message-ID: <50E81BD0.6010201@seld.be> Date: Sat, 05 Jan 2013 13:25:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: internals@lists.php.net References: <50E41BB6.4030901@zerocue.com> In-Reply-To: <50E41BB6.4030901@zerocue.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk6P3bCQ1hnRLMxIh9+TgosD/pqU9aQ0v9JGCWh2aQdFHEwSmrwsjhGLTyu+H/1IoZ203F/ Subject: Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 for Final Review before Vote From: j.boggiano@seld.be (Jordi Boggiano) On 02.01.2013 12:36, Clint Priest wrote: > Here is the updated RFC incorporating the feedback from previous rounds > of discussion. > > https://wiki.php.net/rfc/propertygetsetsyntax-v1.2 One thing that I have not found in the RFC is how do you specify a default value AND accessors? Many examples show things like: protected $Seconds = 3600; public $Hours { get { return $this->Seconds / 3600; } set { $this->Seconds = $value * 3600; } } But what if I want to store something in a different internal representation for example with a default. Is this valid syntax? public $hexFoo = 10 { get { return dechex($this->foo); } set { $this->hexFoo = hexdec($value); } } Or is it this? public $hexFoo { get { return dechex($this->foo); } set { $this->hexFoo = hexdec($value); } } = 10; Is it possible at all? Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi