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